Skip to content

Commit 7019b3e

Browse files
committed
Auto merge of #8015 - aleksator:run_through_clippy, r=alexcrichton
Run through clippy
2 parents ceaa4c2 + 13cd4fb commit 7019b3e

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/cargo/core/compiler/fingerprint.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,9 @@ impl Fingerprint {
833833
let (dep_path, dep_mtime) = if dep.only_requires_rmeta {
834834
dep_mtimes
835835
.iter()
836-
.filter(|(path, _mtime)| {
836+
.find(|(path, _mtime)| {
837837
path.extension().and_then(|s| s.to_str()) == Some("rmeta")
838838
})
839-
.next()
840839
.expect("failed to find rmeta")
841840
} else {
842841
match dep_mtimes.iter().max_by_key(|kv| kv.1) {

src/cargo/core/compiler/job_queue.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
389389
.jobserver
390390
.clone()
391391
.into_helper_thread(move |token| {
392-
drop(messages.push(Message::Token(token)));
392+
messages.push(Message::Token(token));
393393
})
394394
.chain_err(|| "failed to create helper thread for jobserver management")?;
395395

@@ -405,7 +405,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
405405
.rustfix_diagnostic_server
406406
.borrow_mut()
407407
.take()
408-
.map(move |srv| srv.start(move |msg| drop(messages.push(Message::FixDiagnostic(msg)))));
408+
.map(move |srv| srv.start(move |msg| messages.push(Message::FixDiagnostic(msg))));
409409

410410
crossbeam_utils::thread::scope(move |scope| state.drain_the_queue(cx, plan, scope, &helper))
411411
.expect("child threads shouldn't panic")
@@ -634,7 +634,7 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
634634
}
635635
}
636636
}
637-
return events;
637+
events
638638
}
639639

640640
fn drain_the_queue(

src/cargo/util/toml/targets.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,12 @@ fn validate_target_name(
731731
if name.trim().is_empty() {
732732
anyhow::bail!("{} target names cannot be empty", target_kind_human)
733733
}
734-
if cfg!(windows) {
735-
if restricted_names::is_windows_reserved(name) {
736-
warnings.push(format!(
737-
"{} target `{}` is a reserved Windows filename, \
734+
if cfg!(windows) && restricted_names::is_windows_reserved(name) {
735+
warnings.push(format!(
736+
"{} target `{}` is a reserved Windows filename, \
738737
this target will not work on Windows platforms",
739-
target_kind_human, name
740-
));
741-
}
738+
target_kind_human, name
739+
));
742740
}
743741
}
744742
None => anyhow::bail!(

0 commit comments

Comments
 (0)