Skip to content

Commit d34bf02

Browse files
authored
Merge pull request #2901 from hi-rustin/rustin-patch-clippy
Make clippy happy
2 parents 75594ba + 4d7058b commit d34bf02

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/dist/component/package.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ fn unpack_without_first_dir<'a, R: Read>(
349349
/// has been fully dispatched.
350350
fn flush_ios<'a, R: std::io::Read, P: AsRef<Path>>(
351351
io_executor: &mut dyn Executor,
352-
mut directories: &mut HashMap<PathBuf, DirStatus>,
352+
directories: &mut HashMap<PathBuf, DirStatus>,
353353
mut sender_entry: Option<&mut SenderEntry<'a, '_, R>>,
354354
full_path: P,
355355
) -> Result<bool> {
356356
let mut result = sender_entry.is_none();
357357
for mut op in io_executor.completed().collect::<Vec<_>>() {
358358
// TODO capture metrics
359359
filter_result(&mut op)?;
360-
trigger_children(&*io_executor, &mut directories, op)?;
360+
trigger_children(&*io_executor, directories, op)?;
361361
}
362362
// Maybe stream a file incrementally
363363
if let Some(sender) = sender_entry.as_mut() {

src/dist/dist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn components_missing_msg(cs: &[Component], manifest: &ManifestV2, toolchain: &s
5252
);
5353

5454
if toolchain.starts_with("nightly") {
55-
let _ = write!(buf, "{}", nightly_tips.to_string());
55+
let _ = write!(buf, "{}", nightly_tips);
5656
}
5757

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

7575
if toolchain.starts_with("nightly") {
76-
let _ = write!(buf, "{}", nightly_tips.to_string());
76+
let _ = write!(buf, "{}", nightly_tips);
7777
}
7878
let _ = write!(
7979
buf,
@@ -685,7 +685,7 @@ fn update_from_dist_<'a>(
685685
// bunch of the tests, which (inexplicably) use 2015-01-01 as their manifest dates.
686686
let first_manifest = Utc.from_utc_date(&NaiveDate::from_ymd(2014, 12, 20));
687687
let old_manifest = old_date
688-
.and_then(|date| utc_from_manifest_date(date))
688+
.and_then(utc_from_manifest_date)
689689
.unwrap_or(first_manifest);
690690
let last_manifest = if allow_downgrade {
691691
first_manifest

src/fallback_settings.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ use anyhow::{Context, Result};
66

77
use crate::utils::utils;
88

9-
#[derive(Clone, Debug, Deserialize, PartialEq)]
9+
#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
1010
pub struct FallbackSettings {
1111
pub default_toolchain: Option<String>,
1212
}
1313

14-
impl Default for FallbackSettings {
15-
fn default() -> Self {
16-
Self {
17-
default_toolchain: None,
18-
}
19-
}
20-
}
21-
2214
impl FallbackSettings {
2315
pub(crate) fn new<P: AsRef<Path>>(path: P) -> Result<Option<Self>> {
2416
// Users cannot fix issues with missing/unreadable/invalid centralised files, but logging isn't setup early so

0 commit comments

Comments
 (0)