mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-22 03:40:03 +00:00
Refactor: Extract CratesToml::append{_to_path}
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ef72f851f7
commit
31d9716d28
2 changed files with 21 additions and 6 deletions
|
@ -109,12 +109,8 @@ async fn install_from_package(
|
|||
|
||||
let bins: BTreeSet<String> = bin_files.into_iter().map(|bin| bin.base_name).collect();
|
||||
|
||||
{
|
||||
debug!("Writing .crates.toml");
|
||||
let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default();
|
||||
c1.insert(cvs.clone(), bins.clone());
|
||||
c1.write()?;
|
||||
}
|
||||
debug!("Writing .crates.toml");
|
||||
metafiles::v1::CratesToml::append(cvs.clone(), bins.clone())?;
|
||||
|
||||
{
|
||||
debug!("Writing .crates2.json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue