Skip to content

Commit b9036a4

Browse files
committed
Fix crash in cargo dev rename_lint
1 parent 4f28e71 commit b9036a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn replace_region_in_text<'a>(
744744
fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
745745
match fs::OpenOptions::new().create_new(true).write(true).open(new_name) {
746746
Ok(file) => drop(file),
747-
Err(e) if e.kind() == io::ErrorKind::AlreadyExists => return false,
747+
Err(e) if matches!(e.kind(), io::ErrorKind::AlreadyExists | io::ErrorKind::NotFound) => return false,
748748
Err(e) => panic_file(e, new_name, "create"),
749749
};
750750
match fs::rename(old_name, new_name) {

0 commit comments

Comments
 (0)