Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
use the matches! macro (clippy)
Browse files Browse the repository at this point in the history
  • Loading branch information
realtimetodie committed Nov 25, 2022
1 parent 699050d commit 6673495
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/rome_cli/src/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,14 @@ fn process_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) -> FileRes
};
}

let fs_write_access = match ctx.execution.traversal_mode() {
let write_access = !matches!(
ctx.execution.traversal_mode(),
TraversalMode::Check {
fix_file_mode: None,
} => false,
_ => true,
};
} | TraversalMode::Format { write: true, .. }
);

let open_options = OpenOptions::default().read(true).write(fs_write_access);
let open_options = OpenOptions::default().read(true).write(write_access);
let mut file = ctx
.fs
.open_with_options(path, open_options)
Expand Down

0 comments on commit 6673495

Please sign in to comment.