Skip to content

Commit

Permalink
Auto merge of #8015 - aleksator:run_through_clippy, r=alexcrichton
Browse files Browse the repository at this point in the history
Run through clippy
  • Loading branch information
bors committed Mar 17, 2020
2 parents ceaa4c2 + 13cd4fb commit 7019b3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;

Expand All @@ -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")
Expand Down Expand Up @@ -634,7 +634,7 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
}
}
}
return events;
events
}

fn drain_the_queue(
Expand Down
12 changes: 5 additions & 7 deletions src/cargo/util/toml/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 7019b3e

Please sign in to comment.