mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-19 02:10:03 +00:00
More mionr optimizations (#553)
* Optimize `BinFile::preview_bin`: Use `Path::display` instead of `to_string_lossy` to avoid allocation. * Refactor: Rm useless `AsRef::as_ref` call * Optimize `GhCrateMeta::find`: Reduce fut size by converting `Url` to `String` `Url` is much larger than `String`. * Refactor `PackageInfo::resolve`: Destruct `Meta::binstall` * Optimize `resolve::load_manifest_path`: Avoid allocation Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
707b173de1
commit
66abf1b8c1
4 changed files with 28 additions and 20 deletions
|
@ -124,7 +124,10 @@ impl super::Fetcher for GhCrateMeta {
|
|||
return Ok(false);
|
||||
};
|
||||
|
||||
let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/'));
|
||||
// Convert Option<Url> to Option<String> to reduce size of future.
|
||||
let repo = repo.map(String::from);
|
||||
let repo = repo.as_deref().map(|u| u.trim_end_matches('/'));
|
||||
|
||||
let launch_baseline_find_tasks = |pkg_fmt| {
|
||||
match &pkg_urls {
|
||||
Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue