@@ -48,9 +48,7 @@ fn start(argc: int, argv: **u8) -> int {
48
48
49
49
pub fn main ( ) {
50
50
let args = os:: args ( ) ;
51
- let config = parse_config ( args. move_iter ( )
52
- . map ( |x| x. to_string ( ) )
53
- . collect ( ) ) ;
51
+ let config = parse_config ( args) ;
54
52
log_config ( & config) ;
55
53
run_tests ( & config) ;
56
54
}
@@ -131,17 +129,15 @@ pub fn parse_config(args: Vec<String> ) -> Config {
131
129
} ;
132
130
133
131
Config {
134
- compile_lib_path : matches. opt_str ( "compile-lib-path" )
135
- . unwrap ( )
136
- . to_string ( ) ,
137
- run_lib_path : matches. opt_str ( "run-lib-path" ) . unwrap ( ) . to_string ( ) ,
132
+ compile_lib_path : matches. opt_str ( "compile-lib-path" ) . unwrap ( ) ,
133
+ run_lib_path : matches. opt_str ( "run-lib-path" ) . unwrap ( ) ,
138
134
rustc_path : opt_path ( matches, "rustc-path" ) ,
139
135
clang_path : matches. opt_str ( "clang-path" ) . map ( |s| Path :: new ( s) ) ,
140
136
llvm_bin_path : matches. opt_str ( "llvm-bin-path" ) . map ( |s| Path :: new ( s) ) ,
141
137
src_base : opt_path ( matches, "src-base" ) ,
142
138
build_base : opt_path ( matches, "build-base" ) ,
143
139
aux_base : opt_path ( matches, "aux-base" ) ,
144
- stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) . to_string ( ) ,
140
+ stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
145
141
mode : FromStr :: from_str ( matches. opt_str ( "mode" )
146
142
. unwrap ( )
147
143
. as_slice ( ) ) . expect ( "invalid mode" ) ,
@@ -155,32 +151,23 @@ pub fn parse_config(args: Vec<String> ) -> Config {
155
151
ratchet_noise_percent :
156
152
matches. opt_str ( "ratchet-noise-percent" )
157
153
. and_then ( |s| from_str :: < f64 > ( s. as_slice ( ) ) ) ,
158
- runtool : matches. opt_str ( "runtool" ) . map ( |x| x. to_string ( ) ) ,
159
- host_rustcflags : matches. opt_str ( "host-rustcflags" )
160
- . map ( |x| x. to_string ( ) ) ,
161
- target_rustcflags : matches. opt_str ( "target-rustcflags" )
162
- . map ( |x| x. to_string ( ) ) ,
154
+ runtool : matches. opt_str ( "runtool" ) ,
155
+ host_rustcflags : matches. opt_str ( "host-rustcflags" ) ,
156
+ target_rustcflags : matches. opt_str ( "target-rustcflags" ) ,
163
157
jit : matches. opt_present ( "jit" ) ,
164
- target : opt_str2 ( matches. opt_str ( "target" ) . map ( |x| x . to_string ( ) ) ) ,
165
- host : opt_str2 ( matches. opt_str ( "host" ) . map ( |x| x . to_string ( ) ) ) ,
158
+ target : opt_str2 ( matches. opt_str ( "target" ) ) ,
159
+ host : opt_str2 ( matches. opt_str ( "host" ) ) ,
166
160
android_cross_path : opt_path ( matches, "android-cross-path" ) ,
167
- adb_path : opt_str2 ( matches. opt_str ( "adb-path" )
168
- . map ( |x| x. to_string ( ) ) ) ,
169
- adb_test_dir : opt_str2 ( matches. opt_str ( "adb-test-dir" )
170
- . map ( |x| x. to_string ( ) ) ) ,
161
+ adb_path : opt_str2 ( matches. opt_str ( "adb-path" ) ) ,
162
+ adb_test_dir : opt_str2 ( matches. opt_str ( "adb-test-dir" ) ) ,
171
163
adb_device_status :
172
164
"arm-linux-androideabi" ==
173
- opt_str2 ( matches. opt_str ( "target" )
174
- . map ( |x| x. to_string ( ) ) ) . as_slice ( ) &&
165
+ opt_str2 ( matches. opt_str ( "target" ) ) . as_slice ( ) &&
175
166
"(none)" !=
176
- opt_str2 ( matches. opt_str ( "adb-test-dir" )
177
- . map ( |x| x. to_string ( ) ) ) . as_slice ( ) &&
178
- !opt_str2 ( matches. opt_str ( "adb-test-dir" )
179
- . map ( |x| x. to_string ( ) ) ) . is_empty ( ) ,
180
- lldb_python_dir : matches. opt_str ( "lldb-python-dir" )
181
- . map ( |x| x. to_string ( ) ) ,
182
- test_shard : test:: opt_shard ( matches. opt_str ( "test-shard" )
183
- . map ( |x| x. to_string ( ) ) ) ,
167
+ opt_str2 ( matches. opt_str ( "adb-test-dir" ) ) . as_slice ( ) &&
168
+ !opt_str2 ( matches. opt_str ( "adb-test-dir" ) ) . is_empty ( ) ,
169
+ lldb_python_dir : matches. opt_str ( "lldb-python-dir" ) ,
170
+ test_shard : test:: opt_shard ( matches. opt_str ( "test-shard" ) ) ,
184
171
verbose : matches. opt_present ( "verbose" )
185
172
}
186
173
}
0 commit comments