Skip to content

Commit 1e3b423

Browse files
committed
chore: fixed clippy
1 parent 26cf274 commit 1e3b423

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/cargo/ops/cargo_uninstall.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::util::errors::CargoResult;
66
use crate::util::Config;
77
use crate::util::Filesystem;
88
use anyhow::bail;
9-
use cargo_util::paths;
109
use std::collections::BTreeSet;
1110
use std::env;
1211

@@ -103,7 +102,6 @@ fn uninstall_pkgid(
103102
bins: &[String],
104103
config: &Config,
105104
) -> CargoResult<()> {
106-
let mut to_remove = Vec::new();
107105
let installed = match tracker.installed_bins(pkgid) {
108106
Some(bins) => bins.clone(),
109107
None => bail!("package `{}` is not installed", pkgid),
@@ -137,11 +135,13 @@ fn uninstall_pkgid(
137135
}
138136
}
139137

140-
if bins.is_empty() {
141-
to_remove = installed.iter().collect();
142-
} else {
143-
to_remove = bins.iter().collect();
144-
}
138+
let to_remove: Vec<&String> = {
139+
if bins.is_empty() {
140+
installed.iter().collect()
141+
} else {
142+
bins.iter().collect()
143+
}
144+
};
145145

146146
for bin in to_remove {
147147
let bin_path = dst.join(bin);

tests/testsuite/install.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,9 +2530,7 @@ fn uninstall_running_binary() {
25302530
r#"
25312531
use std::{{thread, time}};
25322532
fn main() {
2533-
println!("start longrunning job.");
25342533
thread::sleep(time::Duration::from_secs(3));
2535-
println!("end longrunning job.");
25362534
}
25372535
"#,
25382536
)

0 commit comments

Comments
 (0)