diff --git a/download/src/lib.rs b/download/src/lib.rs index 2864e7b6a1..19b2be87dd 100644 --- a/download/src/lib.rs +++ b/download/src/lib.rs @@ -47,12 +47,13 @@ fn download_with_backend( } } +type DownloadCallback<'a> = &'a dyn Fn(Event<'_>) -> Result<()>; pub fn download_to_path_with_backend( backend: Backend, url: &Url, path: &Path, resume_from_partial: bool, - callback: Option<&dyn Fn(Event<'_>) -> Result<()>>, + callback: Option>, ) -> Result<()> { use std::cell::RefCell; use std::fs::remove_file; diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs index ecf3eac794..cc5ddae023 100644 --- a/src/cli/self_update.rs +++ b/src/cli/self_update.rs @@ -89,7 +89,7 @@ pub(crate) const NEVER_SELF_UPDATE: bool = true; #[cfg(not(feature = "no-self-update"))] pub(crate) const NEVER_SELF_UPDATE: bool = false; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum SelfUpdateMode { Enable, Disable, diff --git a/src/dist/manifest.rs b/src/dist/manifest.rs index 32b1b36a8b..77c5dda4cb 100644 --- a/src/dist/manifest.rs +++ b/src/dist/manifest.rs @@ -24,7 +24,7 @@ use crate::utils::toml_utils::*; pub(crate) const SUPPORTED_MANIFEST_VERSIONS: [&str; 1] = ["2"]; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Manifest { manifest_version: String, pub date: String, @@ -34,25 +34,25 @@ pub struct Manifest { profiles: HashMap>, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Package { pub version: String, pub targets: PackageTargets, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum PackageTargets { Wildcard(TargetedPackage), Targeted(HashMap), } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct TargetedPackage { pub bins: Vec<(CompressionKind, HashedBinary)>, pub components: Vec, } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum CompressionKind { GZip, XZ, @@ -77,7 +77,7 @@ impl CompressionKind { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct HashedBinary { pub url: String, pub hash: String, diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index 7fb33df053..26e9536d37 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -61,7 +61,7 @@ impl Changes { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Debug, Eq)] pub enum UpdateStatus { Changed, Unchanged, diff --git a/src/fallback_settings.rs b/src/fallback_settings.rs index 67dbc01d4f..7d3cd2e9cc 100644 --- a/src/fallback_settings.rs +++ b/src/fallback_settings.rs @@ -6,7 +6,7 @@ use anyhow::{Context, Result}; use crate::utils::utils; -#[derive(Clone, Debug, Deserialize, PartialEq, Default)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Default)] pub struct FallbackSettings { pub default_toolchain: Option, } diff --git a/src/settings.rs b/src/settings.rs index af70d21396..1a5051d5e3 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -15,7 +15,7 @@ use crate::utils::utils; pub(crate) const SUPPORTED_METADATA_VERSIONS: [&str; 2] = ["2", "12"]; pub(crate) const DEFAULT_METADATA_VERSION: &str = "12"; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct SettingsFile { path: PathBuf, cache: RefCell>, @@ -72,7 +72,7 @@ impl SettingsFile { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Settings { pub version: String, pub default_host_triple: Option, diff --git a/tests/mock/clitools.rs b/tests/mock/clitools.rs index 1cad57f1cd..d7acecd32f 100644 --- a/tests/mock/clitools.rs +++ b/tests/mock/clitools.rs @@ -51,7 +51,7 @@ pub struct Config { // Describes all the features of the mock dist server. // Building the mock server is slow, so use simple scenario when possible. -#[derive(PartialEq, Copy, Clone)] +#[derive(Copy, Clone, Eq, PartialEq)] pub enum Scenario { /// No dist server content Empty,