@@ -26,28 +26,28 @@ extern crate tempdir;
26
26
extern crate toml;
27
27
extern crate xz2;
28
28
29
+ use std:: env;
30
+ use std:: ffi:: OsString ;
29
31
use std:: fmt;
30
32
use std:: fs;
31
- use std:: env;
32
- use std:: process:: { self , Command , Stdio } ;
33
- use std:: path:: { Path , PathBuf } ;
34
33
use std:: io:: { self , Read } ;
35
- use std:: ffi:: OsString ;
34
+ use std:: path:: { Path , PathBuf } ;
35
+ use std:: process:: { self , Command , Stdio } ;
36
36
use std:: str:: FromStr ;
37
37
38
+ use chrono:: { Date , Duration , Utc } ;
38
39
use dialoguer:: Select ;
39
- use tempdir:: TempDir ;
40
40
use failure:: Error ;
41
- use structopt:: StructOpt ;
42
- use reqwest:: { Client , Response } ;
41
+ use flate2:: read:: GzDecoder ;
43
42
use pbr:: { ProgressBar , Units } ;
44
- use tee:: TeeReader ;
43
+ use reqwest:: header:: ContentLength ;
44
+ use reqwest:: { Client , Response } ;
45
+ use structopt:: StructOpt ;
45
46
use tar:: Archive ;
47
+ use tee:: TeeReader ;
48
+ use tempdir:: TempDir ;
46
49
use toml:: Value ;
47
- use reqwest:: header:: ContentLength ;
48
50
use xz2:: read:: XzDecoder ;
49
- use flate2:: read:: GzDecoder ;
50
- use chrono:: { Date , Duration , Utc } ;
51
51
52
52
/// The first commit which build artifacts are made available through the CI for
53
53
/// bisection.
@@ -74,8 +74,9 @@ fn get_commits(start: &str, end: &str) -> Result<Vec<git::Commit>, Error> {
74
74
75
75
#[ derive( Debug , StructOpt ) ]
76
76
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
+ ) ]
79
80
alt : bool ,
80
81
81
82
#[ structopt( long = "host" , help = "Host triple for the compiler" , default_value = "unknown" ) ]
@@ -87,37 +88,49 @@ struct Opts {
87
88
#[ structopt( long = "preserve" , help = "Preserve the downloaded artifacts" ) ]
88
89
preserve : bool ,
89
90
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
+ ) ]
92
94
with_cargo : bool ,
93
95
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
+ ) ]
97
101
test_dir : PathBuf ,
98
102
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
+ ) ]
102
108
prompt : bool ,
103
109
104
110
#[ structopt( short = "v" , long = "verbose" , parse( from_occurrences) ) ]
105
111
verbosity : usize ,
106
112
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
+ ) ]
109
118
cargo_args : Vec < OsString > ,
110
119
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
+ ) ]
113
124
start : Option < Bound > ,
114
125
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
+ ) ]
117
129
end : Option < Bound > ,
118
130
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
+ ) ]
121
134
by_commit : bool ,
122
135
123
136
#[ structopt( long = "install" , help = "install the given artifact" ) ]
@@ -462,8 +475,12 @@ impl Toolchain {
462
475
cargo. arg ( & format ! ( "+{}" , self . rustup_name( ) ) ) ;
463
476
cargo. current_dir ( & cfg. args . test_dir ) ;
464
477
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
+ ) ;
466
482
cargo. env ( "CARGO_TARGET_DIR" , format ! ( "target-{}" , self . rustup_name( ) ) ) ;
483
+
467
484
if cfg. args . cargo_args . is_empty ( ) {
468
485
cargo. arg ( "build" ) ;
469
486
} else {
0 commit comments