From e91ec8e880062c1822d08f47dac48dffeab4548f Mon Sep 17 00:00:00 2001 From: mo8it Date: Fri, 1 Mar 2024 00:18:12 +0100 Subject: Optimize getting a relative path --- helix-term/src/ui/statusline.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-term/src/ui/statusline.rs') diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index c3464067..7437cbd0 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -482,7 +482,7 @@ where let rel_path = context.doc.relative_path(); let path = rel_path .as_ref() - .and_then(|p| p.as_path().file_name().map(|s| s.to_string_lossy())) + .and_then(|p| p.file_name().map(|s| s.to_string_lossy())) .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into()); format!(" {} ", path) }; -- cgit v1.2.3-70-g09d2