Replace if let with match.

This commit is contained in:
Nick Rolfe
2021-09-20 12:22:55 +01:00
parent 0936c4cd7b
commit c30c7b380d

View File

@@ -267,13 +267,16 @@ fn path_for(dir: &Path, path: &Path, ext: &str) -> PathBuf {
}
}
}
if let Some(x) = result.extension() {
let mut new_ext = x.to_os_string();
new_ext.push(".");
new_ext.push(ext);
result.set_extension(new_ext);
} else {
result.set_extension(ext);
match result.extension() {
Some(x) => {
let mut new_ext = x.to_os_string();
new_ext.push(".");
new_ext.push(ext);
result.set_extension(new_ext);
}
None => {
result.set_extension(ext);
}
}
result
}