We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17cb2b1 commit 7aa69e5Copy full SHA for 7aa69e5
src/cargo-fmt/main.rs
@@ -109,9 +109,9 @@ fn execute() -> i32 {
109
let strategy = CargoFmtStrategy::from_opts(&opts);
110
let mut rustfmt_args = opts.rustfmt_options;
111
if opts.check {
112
- let check_flag = String::from("--check");
113
- if !rustfmt_args.contains(&check_flag) {
114
- 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());
115
}
116
117
if let Some(message_format) = opts.message_format {
0 commit comments