From fc34efea124c23285770f9bd2e23dbcb905a6965 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 5 Jul 2021 10:34:48 +0900 Subject: appease clippy --- helix-view/src/document.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 2ab1602e..a2bd1c41 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1049,10 +1049,9 @@ impl Document { let cwdir = std::env::current_dir().expect("couldn't determine current directory"); self.path.as_ref().map(|path| { - let path = if path.is_relative() { - path.as_path() - } else { - path.strip_prefix(cwdir).unwrap_or(path.as_path()) + let mut path = path.as_path(); + if path.is_absolute() { + path = path.strip_prefix(cwdir).unwrap_or(path) }; fold_home_dir(path) }) -- cgit v1.2.3-70-g09d2