summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-11-25 18:35:39 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-28 23:58:37 +0100
commit994bdb9b004049023823f19d7d2b848dd62e53c5 (patch)
treec4210e1a36c3e1327162e2eccf5d5d1adbc410fe /pkgs
parentflake.nix: Point snm's module to the new location (diff)
downloadnixos-config-994bdb9b004049023823f19d7d2b848dd62e53c5.zip
pkgs/rollup: Use `try_exists` instead of `exists`
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ro/rollup/src/main.rs10
1 files changed, 5 insertions, 5 deletions
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());
}