Fix crate normalize-path (#508)

* Impl new function `NormalizePath::is_normalized`
* Always normalize and ret `PathBuf` in `NormalizePath::normalize`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-03 21:11:43 +11:00 committed by GitHub
parent 25a4ceb050
commit c48bc2a264
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 25 deletions

View file

@ -113,11 +113,11 @@ impl BinFile {
if !is_valid_path(&path_normalized) {
return Err(BinstallError::InvalidSourceFilePath {
path: path_normalized.into_owned(),
path: path_normalized,
});
}
data.bin_path.join(path_normalized.as_ref())
data.bin_path.join(&path_normalized)
};
// Destination at install dir + base-name{.extension}