From 994bdb9b004049023823f19d7d2b848dd62e53c5 Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Wed, 25 Nov 2026 18:35:39 +0100 Subject: pkgs/rollup: Use `try_exists` instead of `exists` --- pkgs/by-name/ro/rollup/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkgs/by-name/ro') diff --git a/pkgs/by-name/ro/rollup/src/main.rs b/pkgs/by-name/ro/rollup/src/main.rs index bc628898..3b542f6c 100644 --- a/pkgs/by-name/ro/rollup/src/main.rs +++ b/pkgs/by-name/ro/rollup/src/main.rs @@ -291,7 +291,7 @@ fn apply_patches( for file_diff in &patch.files { match file_diff { FileDiff::Add { path, .. } => { - if applies_to.join(path).exists() { + if applies_to.join(path).try_exists()? { bail!("A file was added, that already existed. This should be impossible.") } if drop_in_applies(&config.drop_ins, owner, &root, path)? { @@ -299,7 +299,7 @@ fn apply_patches( } } FileDiff::Remove { path, .. } => { - if applies_to.join(path).exists() { + if applies_to.join(path).try_exists()? { if drop_in_applies(&config.drop_ins, owner, &root, path)? { final_diffs.push(file_diff.to_owned()); } @@ -312,8 +312,8 @@ fn apply_patches( } FileDiff::RenameNoChange { from, to, .. } | FileDiff::RenameWithChange { from, to, .. } => { - if applies_to.join(from).exists() { - if applies_to.join(to).exists() { + if applies_to.join(from).try_exists()? { + if applies_to.join(to).try_exists()? { bail!( "A rename (`{}` -> `{}`) tried to rename a path to an already existing path. This should be impossible.", from.display(), @@ -332,7 +332,7 @@ fn apply_patches( } } FileDiff::Change { path, .. } => { - if applies_to.join(path).exists() { + if applies_to.join(path).try_exists()? { if drop_in_applies(&config.drop_ins, owner, &root, path)? { final_diffs.push(file_diff.to_owned()); } -- cgit v1.3.1