Skip to content

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jul 27, 2019
1 parent 443dca7 commit d60d10a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
25 changes: 14 additions & 11 deletions src/ban.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ fn binary_search<'a>(
Err(i) => {
// Backtrack 1 if the crate name matches, as, for instance, wildcards will be sorted
// before the 0.0.0 version
let begin = if i > 0 && arr[i - 1].name == details.name { i - 1 } else { i };
let begin = if i > 0 && arr[i - 1].name == details.name {
i - 1
} else {
i
};
for (j, crate_) in arr[begin..].iter().enumerate() {
if crate_.name != details.name {
break;
Expand Down Expand Up @@ -761,16 +765,15 @@ mod test {
&(VersionReq::any())
);

assert!(
binary_search(
&versions,
&crate::CrateDetails {
name: "nope".to_owned(),
version: Version::parse("1.0.0").unwrap(),
..Default::default()
}
).is_err()
);
assert!(binary_search(
&versions,
&crate::CrateDetails {
name: "nope".to_owned(),
version: Version::parse("1.0.0").unwrap(),
..Default::default()
}
)
.is_err());

assert_eq!(
binary_search(
Expand Down
19 changes: 10 additions & 9 deletions src/cargo-deny/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ Possible values:

fn real_main() -> Result<(), Error> {
use slog::Drain;
let args = Opts::from_iter({
std::env::args().enumerate().filter_map(|(i, a)| {
if i == 1 && a == "deny" {
None
} else {
Some(a)
}
})
});
let args =
Opts::from_iter({
std::env::args().enumerate().filter_map(|(i, a)| {
if i == 1 && a == "deny" {
None
} else {
Some(a)
}
})
});

let drain = match args.msg_format {
MessageFormat::Human => {
Expand Down

0 comments on commit d60d10a

Please sign in to comment.