mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 01:42:54 +03:00
refactor: use iter workaround for contains() gap
This commit is contained in:
committed by
Caleb Cartwright
parent
17cb2b147e
commit
7aa69e5bc8
@@ -109,9 +109,9 @@ fn execute() -> i32 {
|
||||
let strategy = CargoFmtStrategy::from_opts(&opts);
|
||||
let mut rustfmt_args = opts.rustfmt_options;
|
||||
if opts.check {
|
||||
let check_flag = String::from("--check");
|
||||
if !rustfmt_args.contains(&check_flag) {
|
||||
rustfmt_args.push(check_flag);
|
||||
let check_flag = "--check";
|
||||
if !rustfmt_args.iter().any(|o| o == check_flag) {
|
||||
rustfmt_args.push(check_flag.to_owned());
|
||||
}
|
||||
}
|
||||
if let Some(message_format) = opts.message_format {
|
||||
|
||||
Reference in New Issue
Block a user