Skip to content

Commit c30c7b3

Browse files
committed
Replace if let with match.
1 parent 0936c4c commit c30c7b3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

extractor/src/main.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,16 @@ fn path_for(dir: &Path, path: &Path, ext: &str) -> PathBuf {
267267
}
268268
}
269269
}
270-
if let Some(x) = result.extension() {
271-
let mut new_ext = x.to_os_string();
272-
new_ext.push(".");
273-
new_ext.push(ext);
274-
result.set_extension(new_ext);
275-
} else {
276-
result.set_extension(ext);
270+
match result.extension() {
271+
Some(x) => {
272+
let mut new_ext = x.to_os_string();
273+
new_ext.push(".");
274+
new_ext.push(ext);
275+
result.set_extension(new_ext);
276+
}
277+
None => {
278+
result.set_extension(ext);
279+
}
277280
}
278281
result
279282
}

0 commit comments

Comments
 (0)