Skip to content

Commit 981703c

Browse files
committed
fix: windows path bug
1 parent e7e9378 commit 981703c

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/koharu-runtime/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ publish = true
1515
[dependencies]
1616
anyhow = { workspace = true }
1717
dirs = { workspace = true }
18+
dunce = { workspace = true }
1819
futures = { workspace = true }
1920
fs4 = { workspace = true }
2021
koharu-config = { workspace = true }

crates/koharu-runtime/src/runtime/loader.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ static LOADED: OnceLock<Mutex<HashMap<PathBuf, libloading::Library>>> = OnceLock
1010

1111
pub(super) fn load(path: impl AsRef<Path>) -> Result<()> {
1212
let path = path.as_ref();
13-
let path = path
14-
.canonicalize()
13+
let path = dunce::canonicalize(path)
1514
.with_context(|| format!("dynamic library does not exist: {}", path.display()))?;
1615
let mut loaded = LOADED
1716
.get_or_init(|| Mutex::new(HashMap::new()))

0 commit comments

Comments
 (0)