From 1d3764a3e7c0decc43faee864a1ba9d00da95dfb Mon Sep 17 00:00:00 2001 From: oluceps Date: Thu, 12 Dec 2024 17:37:14 +0800 Subject: [PATCH] - --- src/util/secmap.rs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/util/secmap.rs b/src/util/secmap.rs index 8bdcf82..4746db6 100644 --- a/src/util/secmap.rs +++ b/src/util/secmap.rs @@ -112,26 +112,23 @@ impl<'a> RencCtx<'a, AgeEnc> { .map(|i| { let file = { let file_pathbuf = PathBuf::from(&i.file); - - if flake_root.is_some() && file_pathbuf.is_relative() { - let mut flake_root = flake_root.clone().expect("yes"); + if file_pathbuf.is_absolute() { + file_pathbuf + } else { + let mut flake_root = flake_root.clone().expect("checked"); flake_root.push(file_pathbuf); flake_root - } else { - file_pathbuf } }; ( i, - ({ - file.canonicalize() - .wrap_err_with(|| eyre!("secret not found: {}", i.file)) - .and_then(|i| { - SecPathBuf::::from(&i) - .read_buffer() - .map(SecBuf::new) - }) - }), + file.canonicalize() + .wrap_err_with(|| eyre!("secret not found: {}", i.file)) + .and_then(|i| { + SecPathBuf::::from(&i) + .read_buffer() + .map(SecBuf::new) + }), ) }) .collect();