Skip to content

Commit

Permalink
Merge pull request rust-lang#3133 from chansuke/hotfix/fix-clippy
Browse files Browse the repository at this point in the history
Fix clippy error
  • Loading branch information
Rustin170506 authored Jan 28, 2023
2 parents 0389dc6 + c3b84fc commit 73df807
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion download/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DownloadCallback<'_>>,
) -> Result<()> {
use std::cell::RefCell;
use std::fs::remove_file;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/dist/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -34,25 +34,25 @@ pub struct Manifest {
profiles: HashMap<Profile, Vec<String>>,
}

#[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<TargetTriple, TargetedPackage>),
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TargetedPackage {
pub bins: Vec<(CompressionKind, HashedBinary)>,
pub components: Vec<Component>,
}

#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CompressionKind {
GZip,
XZ,
Expand All @@ -77,7 +77,7 @@ impl CompressionKind {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct HashedBinary {
pub url: String,
pub hash: String,
Expand Down
2 changes: 1 addition & 1 deletion src/dist/manifestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Changes {
}
}

#[derive(PartialEq, Debug)]
#[derive(PartialEq, Debug, Eq)]
pub enum UpdateStatus {
Changed,
Unchanged,
Expand Down
2 changes: 1 addition & 1 deletion src/fallback_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
}
Expand Down
4 changes: 2 additions & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<Settings>>,
Expand Down Expand Up @@ -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<String>,
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 73df807

Please sign in to comment.