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 6a252c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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,
};
fix_file_mode: Some(_),
} | 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 6a252c9

Please sign in to comment.