refactor: use iter workaround for contains() gap
This commit is contained in:
parent
17cb2b147e
commit
7aa69e5bc8
1 changed files with 3 additions and 3 deletions
|
@ -109,9 +109,9 @@ fn execute() -> i32 {
|
||||||
let strategy = CargoFmtStrategy::from_opts(&opts);
|
let strategy = CargoFmtStrategy::from_opts(&opts);
|
||||||
let mut rustfmt_args = opts.rustfmt_options;
|
let mut rustfmt_args = opts.rustfmt_options;
|
||||||
if opts.check {
|
if opts.check {
|
||||||
let check_flag = String::from("--check");
|
let check_flag = "--check";
|
||||||
if !rustfmt_args.contains(&check_flag) {
|
if !rustfmt_args.iter().any(|o| o == check_flag) {
|
||||||
rustfmt_args.push(check_flag);
|
rustfmt_args.push(check_flag.to_owned());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(message_format) = opts.message_format {
|
if let Some(message_format) = opts.message_format {
|
||||||
|
|
Loading…
Reference in a new issue