diff --git a/src/cargo/core/compiler/fingerprint.rs b/src/cargo/core/compiler/fingerprint.rs index 6acb67f6386..4c1674b1493 100644 --- a/src/cargo/core/compiler/fingerprint.rs +++ b/src/cargo/core/compiler/fingerprint.rs @@ -833,10 +833,9 @@ impl Fingerprint { let (dep_path, dep_mtime) = if dep.only_requires_rmeta { dep_mtimes .iter() - .filter(|(path, _mtime)| { + .find(|(path, _mtime)| { path.extension().and_then(|s| s.to_str()) == Some("rmeta") }) - .next() .expect("failed to find rmeta") } else { match dep_mtimes.iter().max_by_key(|kv| kv.1) { diff --git a/src/cargo/core/compiler/job_queue.rs b/src/cargo/core/compiler/job_queue.rs index 039d93d50d7..4b5ab5c9370 100644 --- a/src/cargo/core/compiler/job_queue.rs +++ b/src/cargo/core/compiler/job_queue.rs @@ -389,7 +389,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> { .jobserver .clone() .into_helper_thread(move |token| { - drop(messages.push(Message::Token(token))); + messages.push(Message::Token(token)); }) .chain_err(|| "failed to create helper thread for jobserver management")?; @@ -405,7 +405,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> { .rustfix_diagnostic_server .borrow_mut() .take() - .map(move |srv| srv.start(move |msg| drop(messages.push(Message::FixDiagnostic(msg))))); + .map(move |srv| srv.start(move |msg| messages.push(Message::FixDiagnostic(msg)))); crossbeam_utils::thread::scope(move |scope| state.drain_the_queue(cx, plan, scope, &helper)) .expect("child threads shouldn't panic") @@ -634,7 +634,7 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> { } } } - return events; + events } fn drain_the_queue( diff --git a/src/cargo/util/toml/targets.rs b/src/cargo/util/toml/targets.rs index 4eee8a192fd..f51c9fe1cb3 100644 --- a/src/cargo/util/toml/targets.rs +++ b/src/cargo/util/toml/targets.rs @@ -731,14 +731,12 @@ fn validate_target_name( if name.trim().is_empty() { anyhow::bail!("{} target names cannot be empty", target_kind_human) } - if cfg!(windows) { - if restricted_names::is_windows_reserved(name) { - warnings.push(format!( - "{} target `{}` is a reserved Windows filename, \ + if cfg!(windows) && restricted_names::is_windows_reserved(name) { + warnings.push(format!( + "{} target `{}` is a reserved Windows filename, \ this target will not work on Windows platforms", - target_kind_human, name - )); - } + target_kind_human, name + )); } } None => anyhow::bail!(