Skip to content

Commit f16efff

Browse files
committed
Run cargo fmt
1 parent 449411f commit f16efff

File tree

19 files changed

+102
-66
lines changed

19 files changed

+102
-66
lines changed

src/bin/cargo/commands/owner.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ pub fn cli() -> App {
77
.about("Manage the owners of a crate on the registry")
88
.arg(opt("quiet", "No output printed to stdout").short("q"))
99
.arg(Arg::with_name("crate"))
10-
.arg(multi_opt("add", "LOGIN", "Name of a user or team to invite as an owner").short("a"))
10+
.arg(
11+
multi_opt(
12+
"add",
13+
"LOGIN",
14+
"Name of a user or team to invite as an owner",
15+
)
16+
.short("a"),
17+
)
1118
.arg(
1219
multi_opt(
1320
"remove",

src/bin/cargo/commands/test.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ pub fn cli() -> App {
1919
.last(true),
2020
)
2121
.arg(
22-
opt("quiet", "Display one character per test instead of one line")
23-
.short("q")
22+
opt(
23+
"quiet",
24+
"Display one character per test instead of one line",
25+
)
26+
.short("q"),
2427
)
2528
.arg_targets_all(
2629
"Test only this package's library unit tests",
@@ -131,9 +134,9 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
131134
} else if test_name.is_some() {
132135
if let CompileFilter::Default { .. } = compile_opts.filter {
133136
compile_opts.filter = ops::CompileFilter::new(
134-
LibRule::Default, // compile the library, so the unit tests can be run filtered
135-
FilterRule::All, // compile the binaries, so the unit tests in binaries can be run filtered
136-
FilterRule::All, // compile the tests, so the integration tests can be run filtered
137+
LibRule::Default, // compile the library, so the unit tests can be run filtered
138+
FilterRule::All, // compile the binaries, so the unit tests in binaries can be run filtered
139+
FilterRule::All, // compile the tests, so the integration tests can be run filtered
137140
FilterRule::none(), // specify --examples to unit test binaries filtered
138141
FilterRule::none(), // specify --benches to unit test benchmarks filtered
139142
); // also, specify --doc to run doc tests filtered

src/bin/cargo/commands/version.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use crate::command_prelude::*;
33
use crate::cli;
44

55
pub fn cli() -> App {
6-
subcommand("version").about("Show version information")
6+
subcommand("version")
7+
.about("Show version information")
78
.arg(opt("quiet", "No output printed to stdout").short("q"))
89
}
910

src/cargo/core/compiler/build_context/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ impl TargetConfig {
265265
}
266266
"rustc-cdylib-link-arg" => {
267267
let args = value.list(k)?;
268-
output
269-
.linker_args
270-
.extend(args.iter().map(|v| v.0.clone()));
268+
output.linker_args.extend(args.iter().map(|v| v.0.clone()));
271269
}
272270
"rustc-cfg" => {
273271
let list = value.list(k)?;

src/cargo/core/compiler/context/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,10 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
430430
path.display()
431431
)
432432
};
433-
let suggestion = "Consider changing their names to be unique or compiling them separately.\n\
434-
This may become a hard error in the future; see \
435-
<https://github.com/rust-lang/cargo/issues/6313>.";
433+
let suggestion =
434+
"Consider changing their names to be unique or compiling them separately.\n\
435+
This may become a hard error in the future; see \
436+
<https://github.com/rust-lang/cargo/issues/6313>.";
436437
let report_collision = |unit: &Unit<'_>,
437438
other_unit: &Unit<'_>,
438439
path: &PathBuf|

src/cargo/core/compiler/job_queue.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use crossbeam_utils::thread::Scope;
1111
use jobserver::{Acquired, HelperThread};
1212
use log::{debug, info, trace};
1313

14+
use super::context::OutputFile;
15+
use super::job::Job;
16+
use super::{BuildContext, BuildPlan, CompileMode, Context, Kind, Unit};
1417
use crate::core::profiles::Profile;
1518
use crate::core::{PackageId, Target, TargetKind};
1619
use crate::handle_error;
@@ -19,9 +22,6 @@ use crate::util::diagnostic_server::{self, DiagnosticPrinter};
1922
use crate::util::{internal, profile, CargoResult, CargoResultExt, ProcessBuilder};
2023
use crate::util::{Config, DependencyQueue, Dirty, Fresh, Freshness};
2124
use crate::util::{Progress, ProgressStyle};
22-
use super::context::OutputFile;
23-
use super::job::Job;
24-
use super::{BuildContext, BuildPlan, CompileMode, Context, Kind, Unit};
2525

2626
/// A management structure of the entire dependency graph to compile.
2727
///

src/cargo/core/source/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::collections::hash_map::HashMap;
22
use std::fmt;
33

4-
use crate::core::{Dependency, Package, PackageId, Summary};
54
use crate::core::package::PackageSet;
5+
use crate::core::{Dependency, Package, PackageId, Summary};
66
use crate::util::{CargoResult, Config};
77

88
mod source_id;

src/cargo/ops/cargo_compile.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,16 @@ impl Packages {
126126
if !opt_out.is_empty() {
127127
ws.config().shell().warn(format!(
128128
"excluded package(s) {} not found in workspace `{}`",
129-
opt_out.iter().map(|x| x.as_ref()).collect::<Vec<_>>().join(", "),
129+
opt_out
130+
.iter()
131+
.map(|x| x.as_ref())
132+
.collect::<Vec<_>>()
133+
.join(", "),
130134
ws.root().display(),
131135
))?;
132136
}
133137
packages
134-
},
138+
}
135139
Packages::Packages(packages) if packages.is_empty() => {
136140
vec![PackageIdSpec::from_package_id(ws.current()?.package_id())]
137141
}
@@ -443,7 +447,11 @@ impl CompileFilter {
443447
all_bens: bool,
444448
all_targets: bool,
445449
) -> CompileFilter {
446-
let rule_lib = if lib_only { LibRule::True } else { LibRule::False };
450+
let rule_lib = if lib_only {
451+
LibRule::True
452+
} else {
453+
LibRule::False
454+
};
447455
let rule_bins = FilterRule::new(bins, all_bins);
448456
let rule_tsts = FilterRule::new(tsts, all_tsts);
449457
let rule_exms = FilterRule::new(exms, all_exms);
@@ -527,11 +535,13 @@ impl CompileFilter {
527535
TargetKind::Test => tests,
528536
TargetKind::Bench => benches,
529537
TargetKind::ExampleBin | TargetKind::ExampleLib(..) => examples,
530-
TargetKind::Lib(..) => return match *lib {
531-
LibRule::True => true,
532-
LibRule::Default => true,
533-
LibRule::False => false,
534-
},
538+
TargetKind::Lib(..) => {
539+
return match *lib {
540+
LibRule::True => true,
541+
LibRule::Default => true,
542+
LibRule::False => false,
543+
};
544+
}
535545
TargetKind::CustomBuild => return false,
536546
};
537547
rule.matches(target)

src/cargo/ops/cargo_package.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,7 @@ fn hash_all(path: &Path) -> CargoResult<HashMap<PathBuf, u64>> {
505505
Ok(result)
506506
}
507507

508-
fn report_hash_difference(
509-
orig: &HashMap<PathBuf, u64>,
510-
after: &HashMap<PathBuf, u64>,
511-
) -> String {
508+
fn report_hash_difference(orig: &HashMap<PathBuf, u64>, after: &HashMap<PathBuf, u64>) -> String {
512509
let mut changed = Vec::new();
513510
let mut removed = Vec::new();
514511
for (key, value) in orig {

src/cargo/ops/cargo_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::ffi::OsString;
22

33
use crate::core::compiler::{Compilation, Doctest};
4-
use crate::core::Workspace;
54
use crate::core::shell::Verbosity;
5+
use crate::core::Workspace;
66
use crate::ops;
77
use crate::util::errors::CargoResult;
88
use crate::util::{CargoTestError, ProcessError, Test};

0 commit comments

Comments
 (0)