Skip to content

Commit 948dac3

Browse files
committed
[cli] Fix a clippy warning.
1 parent 5c8325b commit 948dac3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cli/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,7 @@ fn run_simulator() -> Result<(), Box<dyn std::error::Error>> {
225225

226226
fn file_size_guess(file_name: &OsStr) -> Option<usize> {
227227
match std::fs::metadata(file_name) {
228-
Ok(metadata) => match usize::try_from(metadata.len()) {
229-
Ok(n) => Some(n),
230-
Err(_) => None,
231-
},
228+
Ok(metadata) => usize::try_from(metadata.len()).ok(),
232229
Err(_) => None,
233230
}
234231
}

0 commit comments

Comments
 (0)