mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-08 14:05:10 +02:00
refactor(rust): cleanup path handling
- Avoids unnecessary string allocation when tracing paths - Replaces `mut path & path.push()` with `path.join()` - Avoids unncessary cloning of paths where applicable - Use `dunce` crate to remove `UNC` prefix - Improve performance of resolving `~` by avoiding unnecessary string allocations - Resolve `~`, `$Env:USERPROFILE` and `$HOME` consistenly between different code paths - Use `PathBuf` instead of `String` for paths in CLI args I may have missed a couple of places but I think I covered 90% of path handling in the codebase
This commit is contained in:
Generated
+9
@@ -328,6 +328,12 @@ dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dunce"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
|
||||
|
||||
[[package]]
|
||||
name = "dyn-clone"
|
||||
version = "1.0.16"
|
||||
@@ -824,6 +830,8 @@ version = "0.1.19"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"color-eyre",
|
||||
"dirs",
|
||||
"dunce",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -840,6 +848,7 @@ dependencies = [
|
||||
"color-eyre",
|
||||
"derive-ahk",
|
||||
"dirs",
|
||||
"dunce",
|
||||
"fs-tail",
|
||||
"heck",
|
||||
"komorebi-core",
|
||||
|
||||
Reference in New Issue
Block a user