Skip to content

Commit 22e3718

Browse files
Format code
1 parent 6f5deaa commit 22e3718

File tree

3 files changed

+51
-34
lines changed

3 files changed

+51
-34
lines changed

src/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const RUST_SRC_REPO: Option<&str> = option_env!("RUST_SRC_REPO");
1313
use std::path::Path;
1414

1515
use chrono::{DateTime, TimeZone, Utc};
16-
use git2::{Commit as Git2Commit, Repository};
17-
use git2::build::RepoBuilder;
1816
use failure::Error;
17+
use git2::build::RepoBuilder;
18+
use git2::{Commit as Git2Commit, Repository};
1919

2020
#[derive(Debug, Clone, PartialEq)]
2121
pub struct Commit {

src/least_satisfying.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// http://opensource.org/licenses/MIT>, at your option. This file may not be
66
// copied, modified, or distributed except according to those terms.
77

8-
use std::fmt;
98
use std::collections::BTreeMap;
9+
use std::fmt;
1010

1111
pub fn least_satisfying<T, P>(slice: &[T], mut predicate: P) -> usize
1212
where
@@ -85,8 +85,8 @@ where
8585

8686
#[cfg(test)]
8787
mod tests {
88-
use super::{least_satisfying, Satisfies};
8988
use super::Satisfies::*;
89+
use super::{least_satisfying, Satisfies};
9090
use quickcheck::{QuickCheck, TestResult};
9191

9292
fn prop(xs: Vec<Option<bool>>) -> TestResult {

src/main.rs

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ extern crate tempdir;
2626
extern crate toml;
2727
extern crate xz2;
2828

29+
use std::env;
30+
use std::ffi::OsString;
2931
use std::fmt;
3032
use std::fs;
31-
use std::env;
32-
use std::process::{self, Command, Stdio};
33-
use std::path::{Path, PathBuf};
3433
use std::io::{self, Read};
35-
use std::ffi::OsString;
34+
use std::path::{Path, PathBuf};
35+
use std::process::{self, Command, Stdio};
3636
use std::str::FromStr;
3737

38+
use chrono::{Date, Duration, Utc};
3839
use dialoguer::Select;
39-
use tempdir::TempDir;
4040
use failure::Error;
41-
use structopt::StructOpt;
42-
use reqwest::{Client, Response};
41+
use flate2::read::GzDecoder;
4342
use pbr::{ProgressBar, Units};
44-
use tee::TeeReader;
43+
use reqwest::header::ContentLength;
44+
use reqwest::{Client, Response};
45+
use structopt::StructOpt;
4546
use tar::Archive;
47+
use tee::TeeReader;
48+
use tempdir::TempDir;
4649
use toml::Value;
47-
use reqwest::header::ContentLength;
4850
use xz2::read::XzDecoder;
49-
use flate2::read::GzDecoder;
50-
use chrono::{Date, Duration, Utc};
5151

5252
/// The first commit which build artifacts are made available through the CI for
5353
/// bisection.
@@ -74,8 +74,9 @@ fn get_commits(start: &str, end: &str) -> Result<Vec<git::Commit>, Error> {
7474

7575
#[derive(Debug, StructOpt)]
7676
struct Opts {
77-
#[structopt(short = "a", long = "alt",
78-
help = "Download the alt build instead of normal build")]
77+
#[structopt(
78+
short = "a", long = "alt", help = "Download the alt build instead of normal build"
79+
)]
7980
alt: bool,
8081

8182
#[structopt(long = "host", help = "Host triple for the compiler", default_value = "unknown")]
@@ -87,37 +88,49 @@ struct Opts {
8788
#[structopt(long = "preserve", help = "Preserve the downloaded artifacts")]
8889
preserve: bool,
8990

90-
#[structopt(long = "with-cargo",
91-
help = "Download cargo, by default the installed cargo is used")]
91+
#[structopt(
92+
long = "with-cargo", help = "Download cargo, by default the installed cargo is used"
93+
)]
9294
with_cargo: bool,
9395

94-
#[structopt(long = "test-dir",
95-
help = "Directory to test; this is where you usually run `cargo build`",
96-
parse(from_os_str))]
96+
#[structopt(
97+
long = "test-dir",
98+
help = "Directory to test; this is where you usually run `cargo build`",
99+
parse(from_os_str)
100+
)]
97101
test_dir: PathBuf,
98102

99-
#[structopt(long = "prompt",
100-
help = "Display a prompt in between runs to allow for manually \
101-
inspecting output and retrying.")]
103+
#[structopt(
104+
long = "prompt",
105+
help = "Display a prompt in between runs to allow for manually \
106+
inspecting output and retrying."
107+
)]
102108
prompt: bool,
103109

104110
#[structopt(short = "v", long = "verbose", parse(from_occurrences))]
105111
verbosity: usize,
106112

107-
#[structopt(help = "Arguments to pass to cargo when running",
108-
raw(multiple = "true", last = "true"), parse(from_os_str))]
113+
#[structopt(
114+
help = "Arguments to pass to cargo when running",
115+
raw(multiple = "true", last = "true"),
116+
parse(from_os_str)
117+
)]
109118
cargo_args: Vec<OsString>,
110119

111-
#[structopt(long = "start",
112-
help = "the left-bound for the search; this point should *not* have the regression")]
120+
#[structopt(
121+
long = "start",
122+
help = "the left-bound for the search; this point should *not* have the regression"
123+
)]
113124
start: Option<Bound>,
114125

115-
#[structopt(long = "end",
116-
help = "the right-bound for the search; this point should have the regression")]
126+
#[structopt(
127+
long = "end", help = "the right-bound for the search; this point should have the regression"
128+
)]
117129
end: Option<Bound>,
118130

119-
#[structopt(long = "by-commit",
120-
help = "without specifying bounds, bisect via commit artifacts")]
131+
#[structopt(
132+
long = "by-commit", help = "without specifying bounds, bisect via commit artifacts"
133+
)]
121134
by_commit: bool,
122135

123136
#[structopt(long = "install", help = "install the given artifact")]
@@ -462,8 +475,12 @@ impl Toolchain {
462475
cargo.arg(&format!("+{}", self.rustup_name()));
463476
cargo.current_dir(&cfg.args.test_dir);
464477
let _ = fs::remove_dir_all(
465-
cfg.args.test_dir.join(&format!("target-{}", self.rustup_name())));
478+
cfg.args
479+
.test_dir
480+
.join(&format!("target-{}", self.rustup_name())),
481+
);
466482
cargo.env("CARGO_TARGET_DIR", format!("target-{}", self.rustup_name()));
483+
467484
if cfg.args.cargo_args.is_empty() {
468485
cargo.arg("build");
469486
} else {

0 commit comments

Comments
 (0)