Skip to content

Commit b9554f3

Browse files
committed
rustfmt
1 parent 9d9c321 commit b9554f3

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

src/bin/cargo/commands/pkgid.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
1818
if !args.is_present("spec") && args.is_present_with_zero_values("package") {
1919
print_available_packages(&ws)?
2020
}
21-
let spec = args.value_of("spec").or_else(|| {
22-
args.value_of("package")
23-
});
21+
let spec = args.value_of("spec").or_else(|| args.value_of("package"));
2422
let spec = ops::pkgid(&ws, spec)?;
2523
cargo::drop_println!(config, "{}", spec);
2624
Ok(())

src/bin/cargo/commands/uninstall.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
2020
return Err(anyhow::anyhow!(
2121
"\"--package <SPEC>\" requires a SPEC format value.\n\
2222
Run `cargo help pkgid` for more information about SPEC format."
23-
).into())
23+
)
24+
.into());
2425
}
2526

2627
let specs = args

src/cargo/util/command_prelude.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ pub trait AppExt: Sized {
5656
}
5757

5858
fn arg_package(self, package: &'static str) -> Self {
59-
self._arg(optinal_opt("package", package).short("p").value_name("SPEC"))
59+
self._arg(
60+
optinal_opt("package", package)
61+
.short("p")
62+
.value_name("SPEC"),
63+
)
6064
}
6165

6266
fn arg_jobs(self) -> Self {

src/cargo/util/workspace.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ pub fn print_available_packages(ws: &Workspace<'_>) -> CargoResult<()> {
6767
writeln!(output, "No packages available.")?;
6868
} else {
6969
writeln!(output, "Possible packages/workspace members:")?;
70-
for package in packages {
70+
for package in packages {
7171
writeln!(output, " {}", package)?;
7272
}
7373
}
7474
bail!("{}", output)
7575
}
7676

77-
7877
pub fn print_available_examples(ws: &Workspace<'_>, options: &CompileOptions) -> CargoResult<()> {
7978
print_available_targets(Target::is_example, ws, options, "--example", "examples")
8079
}

tests/testsuite/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,8 @@ fn uninstall_multiple_and_specifying_bin() {
11851185
fn uninstall_with_empty_pakcage_option() {
11861186
cargo_process("uninstall -p")
11871187
.with_status(101)
1188-
.with_stderr("\
1188+
.with_stderr(
1189+
"\
11891190
[ERROR] \"--package <SPEC>\" requires a SPEC format value.
11901191
Run `cargo help pkgid` for more information about SPEC format.
11911192
",

0 commit comments

Comments
 (0)