Correct formatting with cargo fmt

This commit is contained in:
Dirkjan Ochtman 2018-04-11 23:16:17 +02:00
parent aafcf98a15
commit 5c241e1027
4 changed files with 24 additions and 11 deletions

View File

@ -244,9 +244,11 @@ impl Context {
if !reqs.used.is_empty() {
let pkgid = s.package_id();
let set = Rc::make_mut(self.resolve_features
.entry(pkgid.clone())
.or_insert_with(|| Rc::new(HashSet::new())));
let set = Rc::make_mut(
self.resolve_features
.entry(pkgid.clone())
.or_insert_with(|| Rc::new(HashSet::new())),
);
for feature in reqs.used {
set.insert(InternedString::new(feature));

View File

@ -479,11 +479,16 @@ fn register_previous_locks<'a>(
// Ok if nothing matches, then we poison the source of this
// dependencies and the previous lock file.
debug!("poisoning {} because {} looks like it changed {}",
dep.source_id(),
member.package_id(),
dep.name());
for id in resolve.iter().filter(|id| id.source_id() == dep.source_id()) {
debug!(
"poisoning {} because {} looks like it changed {}",
dep.source_id(),
member.package_id(),
dep.name()
);
for id in resolve
.iter()
.filter(|id| id.source_id() == dep.source_id())
{
add_deps(resolve, id, &mut avoid_locking);
}
}

View File

@ -1042,13 +1042,16 @@ fn installs_from_cwd_with_2018_warnings() {
.build();
assert_that(
cargo_process("install").cwd(p.root()).masquerade_as_nightly_cargo(),
cargo_process("install")
.cwd(p.root())
.masquerade_as_nightly_cargo(),
execs().with_status(101).with_stderr_contains(
"error: To build the current package use `cargo build`, \
to install the current package run `cargo install --path .`, \
otherwise specify a crate to install from crates.io, \
or use --path or --git to specify alternate source\
"),
",
),
);
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
}

View File

@ -758,7 +758,10 @@ fn install_default_features() {
);
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
assert_that(p.cargo("install --path .").arg("--bin=foo"), execs().with_status(0));
assert_that(
p.cargo("install --path .").arg("--bin=foo"),
execs().with_status(0),
);
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(p.cargo("uninstall").arg("foo"), execs().with_status(0));