aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-07-05 01:34:48 +0000
committerBlaž Hrastnik2021-07-05 01:34:48 +0000
commitfc34efea124c23285770f9bd2e23dbcb905a6965 (patch)
tree9ff899ece5a424e94755c76e669efed552aff688 /helix-view/src
parent48481db8ca3a19c704825adb72a667c4266e9370 (diff)
appease clippy
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/document.rs7
1 files 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)
})