chore: apply clippy fixes (#3092)

This commit is contained in:
Fabian-Lars
2025-11-09 18:43:17 +01:00
committed by GitHub
parent 5cd7778723
commit 5438a5cd22
6 changed files with 11 additions and 32 deletions
+2 -7
View File
@@ -6,9 +6,10 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
/// Types of message, ask and confirm dialogs.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Default)]
pub enum MessageDialogKind {
/// Information dialog.
#[default]
Info,
/// Warning dialog.
Warning,
@@ -16,12 +17,6 @@ pub enum MessageDialogKind {
Error,
}
impl Default for MessageDialogKind {
fn default() -> Self {
Self::Info
}
}
impl<'de> Deserialize<'de> for MessageDialogKind {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
+2 -6
View File
@@ -12,8 +12,10 @@ mod scope;
#[derive(schemars::JsonSchema)]
#[serde(untagged)]
#[allow(unused)]
#[derive(Default)]
enum Application {
/// Open in default application.
#[default]
Default,
/// If true, allow open with any application.
Enable(bool),
@@ -21,12 +23,6 @@ enum Application {
App(String),
}
impl Default for Application {
fn default() -> Self {
Self::Default
}
}
/// Opener scope entry.
#[derive(schemars::JsonSchema)]
#[serde(untagged)]
+1 -1
View File
@@ -115,7 +115,7 @@ mod imp {
let parent_item_id_list = OwnedItemIdList::new(parent)?;
let to_reveals_item_id_list = to_reveals
.iter()
.map(|to_reveal| OwnedItemIdList::new(*to_reveal))
.map(|to_reveal| OwnedItemIdList::new(to_reveal))
.collect::<crate::Result<Vec<_>>>()?;
if let Err(e) = unsafe {
SHOpenFolderAndSelectItems(
+2 -6
View File
@@ -8,18 +8,14 @@ use serde::Deserialize;
#[derive(Deserialize, Debug)]
#[serde(untagged)]
#[derive(Default)]
pub enum Application {
#[default]
Default,
Enable(bool),
App(String),
}
impl Default for Application {
fn default() -> Self {
Self::Default
}
}
#[derive(Deserialize)]
#[serde(untagged, rename_all = "camelCase")]
pub(crate) enum EntryRaw {
+2 -6
View File
@@ -17,9 +17,11 @@ pub struct Config {
#[derive(Debug, PartialEq, Eq, Clone, Deserialize)]
#[serde(untagged, deny_unknown_fields)]
#[non_exhaustive]
#[derive(Default)]
pub enum ShellAllowlistOpen {
/// Shell open API allowlist is not defined by the user.
/// In this case we add the default validation regex (same as [`Self::Flag(true)`]).
#[default]
Unset,
/// If the shell open API should be enabled.
///
@@ -35,9 +37,3 @@ pub enum ShellAllowlistOpen {
/// that allow flag-like strings to pass validation. e.g. `--enable-debugging`, `-i`, `/R`.
Validate(String),
}
impl Default for ShellAllowlistOpen {
fn default() -> Self {
Self::Unset
}
}
+2 -6
View File
@@ -10,6 +10,7 @@ use url::Url;
/// Install modes for the Windows update.
#[derive(Debug, PartialEq, Eq, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Default)]
pub enum WindowsUpdateInstallMode {
/// Specifies there's a basic UI during the installation process, including a final dialog box at the end.
BasicUi,
@@ -17,6 +18,7 @@ pub enum WindowsUpdateInstallMode {
/// Requires admin privileges if the installer does.
Quiet,
/// Specifies unattended mode, which means the installation only shows a progress bar.
#[default]
Passive,
}
@@ -57,12 +59,6 @@ impl Display for WindowsUpdateInstallMode {
}
}
impl Default for WindowsUpdateInstallMode {
fn default() -> Self {
Self::Passive
}
}
#[derive(Debug, Clone, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct WindowsConfig {