Skip to content

Commit 7aa69e5

Browse files
refactor: use iter workaround for contains() gap
1 parent 17cb2b1 commit 7aa69e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cargo-fmt/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ fn execute() -> i32 {
109109
let strategy = CargoFmtStrategy::from_opts(&opts);
110110
let mut rustfmt_args = opts.rustfmt_options;
111111
if opts.check {
112-
let check_flag = String::from("--check");
113-
if !rustfmt_args.contains(&check_flag) {
114-
rustfmt_args.push(check_flag);
112+
let check_flag = "--check";
113+
if !rustfmt_args.iter().any(|o| o == check_flag) {
114+
rustfmt_args.push(check_flag.to_owned());
115115
}
116116
}
117117
if let Some(message_format) = opts.message_format {

0 commit comments

Comments
 (0)