Skip to content

Commit

Permalink
Merge pull request #2901 from hi-rustin/rustin-patch-clippy
Browse files Browse the repository at this point in the history
Make clippy happy
  • Loading branch information
rbtcollins authored Nov 25, 2021
2 parents 75594ba + 4d7058b commit d34bf02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/dist/component/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,15 @@ fn unpack_without_first_dir<'a, R: Read>(
/// has been fully dispatched.
fn flush_ios<'a, R: std::io::Read, P: AsRef<Path>>(
io_executor: &mut dyn Executor,
mut directories: &mut HashMap<PathBuf, DirStatus>,
directories: &mut HashMap<PathBuf, DirStatus>,
mut sender_entry: Option<&mut SenderEntry<'a, '_, R>>,
full_path: P,
) -> Result<bool> {
let mut result = sender_entry.is_none();
for mut op in io_executor.completed().collect::<Vec<_>>() {
// TODO capture metrics
filter_result(&mut op)?;
trigger_children(&*io_executor, &mut directories, op)?;
trigger_children(&*io_executor, directories, op)?;
}
// Maybe stream a file incrementally
if let Some(sender) = sender_entry.as_mut() {
Expand Down
6 changes: 3 additions & 3 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
);

if toolchain.starts_with("nightly") {
let _ = write!(buf, "{}", nightly_tips.to_string());
let _ = write!(buf, "{}", nightly_tips);
}

let _ = write!(
Expand All @@ -73,7 +73,7 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
);

if toolchain.starts_with("nightly") {
let _ = write!(buf, "{}", nightly_tips.to_string());
let _ = write!(buf, "{}", nightly_tips);
}
let _ = write!(
buf,
Expand Down Expand Up @@ -685,7 +685,7 @@ fn update_from_dist_<'a>(
// bunch of the tests, which (inexplicably) use 2015-01-01 as their manifest dates.
let first_manifest = Utc.from_utc_date(&NaiveDate::from_ymd(2014, 12, 20));
let old_manifest = old_date
.and_then(|date| utc_from_manifest_date(date))
.and_then(utc_from_manifest_date)
.unwrap_or(first_manifest);
let last_manifest = if allow_downgrade {
first_manifest
Expand Down
10 changes: 1 addition & 9 deletions src/fallback_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ use anyhow::{Context, Result};

use crate::utils::utils;

#[derive(Clone, Debug, Deserialize, PartialEq)]
#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
pub struct FallbackSettings {
pub default_toolchain: Option<String>,
}

impl Default for FallbackSettings {
fn default() -> Self {
Self {
default_toolchain: None,
}
}
}

impl FallbackSettings {
pub(crate) fn new<P: AsRef<Path>>(path: P) -> Result<Option<Self>> {
// Users cannot fix issues with missing/unreadable/invalid centralised files, but logging isn't setup early so
Expand Down

0 comments on commit d34bf02

Please sign in to comment.