From a1a52b10f3d2571f59092d579b29932974322d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Tue, 17 Oct 2023 07:04:27 +0200 Subject: [PATCH] refactor(link): propagate canonicalization errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- src/git.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/git.rs b/src/git.rs index e7ec2d5..02175b7 100644 --- a/src/git.rs +++ b/src/git.rs @@ -172,10 +172,7 @@ impl From for LinkError { fn handle_file_exists(selff: &Link, tx_path: &Path, rx_path: &Path) -> Result { match rx_path.read_link() { - Ok(file) - if file.canonicalize().expect("failed to canonicalize file") - == tx_path.canonicalize().expect("failed to canonicalize path") => - { + Ok(file) if file.canonicalize()? == tx_path.canonicalize()? => { Err(LinkError::AlreadyLinked( tx_path.to_string_lossy().to_string(), rx_path.to_string_lossy().to_string(),