on master help sign in
appease clippy
commitfc34efea124c23285770f9bd2e23dbcb905a6965 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 5 Jul 2021, 10:34 (5 years ago) parent48481db
1 file changed+3−4
helix-view/src/document.rs+3−4
helix-view/src/document.rs+3−4
@@ -1049,10 +1049,9 @@ impl Document {
10491049 let cwdir = std::env::current_dir().expect("couldn't determine current directory");
10501050
10511051 self.path.as_ref().map(|path| {
1052− let path = if path.is_relative() {
1053− path.as_path()
1054− } else {
1055− path.strip_prefix(cwdir).unwrap_or(path.as_path())
1052+ let mut path = path.as_path();
1053+ if path.is_absolute() {
1054+ path = path.strip_prefix(cwdir).unwrap_or(path)
10561055 };
10571056 fold_home_dir(path)
10581057 })