mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-06 04:00:02 +00:00
Fix Vfs::add_path
: Use to_string_lossy
instead of `to_str` to be compatible with the implementation in `cargo_toml`: https://docs.rs/cargo_toml/0.11.5/src/cargo_toml/afs.rs.html#24 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
b88e384f95
commit
bd39ce754f
1 changed files with 8 additions and 6 deletions
|
@ -20,12 +20,14 @@ impl Vfs {
|
||||||
// Since path has parent, it must have a filename
|
// Since path has parent, it must have a filename
|
||||||
let filename = path.file_name().unwrap();
|
let filename = path.file_name().unwrap();
|
||||||
|
|
||||||
if let Some(filename) = filename.to_str() {
|
// `cargo_toml`'s implementation does the same thing.
|
||||||
self.0
|
// https://docs.rs/cargo_toml/0.11.5/src/cargo_toml/afs.rs.html#24
|
||||||
.entry(parent.into())
|
let filename = filename.to_string_lossy();
|
||||||
.or_insert_with(|| HashSet::with_capacity(4))
|
|
||||||
.insert(filename.into());
|
self.0
|
||||||
}
|
.entry(parent.into())
|
||||||
|
.or_insert_with(|| HashSet::with_capacity(4))
|
||||||
|
.insert(filename.into());
|
||||||
|
|
||||||
path = parent;
|
path = parent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue