Avoid Iterator::last
This commit is contained in:
@@ -1309,10 +1309,8 @@ pub fn build_session(
|
||||
let warnings_allow = sopts
|
||||
.lint_opts
|
||||
.iter()
|
||||
.filter(|&&(ref key, _)| *key == "warnings")
|
||||
.map(|&(_, ref level)| *level == lint::Allow)
|
||||
.last()
|
||||
.unwrap_or(false);
|
||||
.rfind(|&&(ref key, _)| *key == "warnings")
|
||||
.map_or(false, |&(_, level)| level == lint::Allow);
|
||||
let cap_lints_allow = sopts.lint_cap.map_or(false, |cap| cap == lint::Allow);
|
||||
let can_emit_warnings = !(warnings_allow || cap_lints_allow);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user