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
|
||||
let filename = path.file_name().unwrap();
|
||||
|
||||
if let Some(filename) = filename.to_str() {
|
||||
self.0
|
||||
.entry(parent.into())
|
||||
.or_insert_with(|| HashSet::with_capacity(4))
|
||||
.insert(filename.into());
|
||||
}
|
||||
// `cargo_toml`'s implementation does the same thing.
|
||||
// https://docs.rs/cargo_toml/0.11.5/src/cargo_toml/afs.rs.html#24
|
||||
let filename = filename.to_string_lossy();
|
||||
|
||||
self.0
|
||||
.entry(parent.into())
|
||||
.or_insert_with(|| HashSet::with_capacity(4))
|
||||
.insert(filename.into());
|
||||
|
||||
path = parent;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue