aboutsummaryrefslogtreecommitdiff
path: root/helix-loader
diff options
context:
space:
mode:
authorMo2024-02-24 15:59:11 +0000
committerGitHub2024-02-24 15:59:11 +0000
commit6db666fce1fb4627c06d147554b8e1eb9970619e (patch)
tree8ed202acf6936485c33f033e6af5f294dfad0da0 /helix-loader
parentec9efdef3b2f613a86098058f5705e7863e375e2 (diff)
Optimization of tilde expansion (#9709)
* Use next and avoid a redundant prefix strip * Avoid allocations Especially when `expand_tilde` is claled on a path that doesn't contain a tilde. * Add a test * Use Into<Cow<…>> * Put the expand_tilde test at the end of the file * Remove unused importsw
Diffstat (limited to 'helix-loader')
-rw-r--r--helix-loader/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs
index f8fac670..93488e45 100644
--- a/helix-loader/src/lib.rs
+++ b/helix-loader/src/lib.rs
@@ -53,7 +53,7 @@ fn prioritize_runtime_dirs() -> Vec<PathBuf> {
rt_dirs.push(conf_rt_dir);
if let Ok(dir) = std::env::var("HELIX_RUNTIME") {
- let dir = path::expand_tilde(dir);
+ let dir = path::expand_tilde(Path::new(&dir));
rt_dirs.push(path::normalize(dir));
}