mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 11:12:25 +00:00
chore: fixed clippy
This commit is contained in:
parent
26cf2740d7
commit
1e3b4231da
|
@ -6,7 +6,6 @@ use crate::util::errors::CargoResult;
|
|||
use crate::util::Config;
|
||||
use crate::util::Filesystem;
|
||||
use anyhow::bail;
|
||||
use cargo_util::paths;
|
||||
use std::collections::BTreeSet;
|
||||
use std::env;
|
||||
|
||||
|
@ -103,7 +102,6 @@ fn uninstall_pkgid(
|
|||
bins: &[String],
|
||||
config: &Config,
|
||||
) -> CargoResult<()> {
|
||||
let mut to_remove = Vec::new();
|
||||
let installed = match tracker.installed_bins(pkgid) {
|
||||
Some(bins) => bins.clone(),
|
||||
None => bail!("package `{}` is not installed", pkgid),
|
||||
|
@ -137,11 +135,13 @@ fn uninstall_pkgid(
|
|||
}
|
||||
}
|
||||
|
||||
if bins.is_empty() {
|
||||
to_remove = installed.iter().collect();
|
||||
} else {
|
||||
to_remove = bins.iter().collect();
|
||||
}
|
||||
let to_remove: Vec<&String> = {
|
||||
if bins.is_empty() {
|
||||
installed.iter().collect()
|
||||
} else {
|
||||
bins.iter().collect()
|
||||
}
|
||||
};
|
||||
|
||||
for bin in to_remove {
|
||||
let bin_path = dst.join(bin);
|
||||
|
|
|
@ -2530,9 +2530,7 @@ fn uninstall_running_binary() {
|
|||
r#"
|
||||
use std::{{thread, time}};
|
||||
fn main() {
|
||||
println!("start longrunning job.");
|
||||
thread::sleep(time::Duration::from_secs(3));
|
||||
println!("end longrunning job.");
|
||||
}
|
||||
"#,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue