File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -146,23 +146,22 @@ fn main() {
146
146
"--" => {
147
147
after_dashdash = true ;
148
148
}
149
- _ => {
150
- let split: Vec < String > = arg. split ( "-Zmiri-seed=" ) . map ( |s| s. to_owned ( ) ) . collect ( ) ;
151
- if split. len ( ) == 2 {
152
- if seed. is_some ( ) {
153
- panic ! ( "Cannot specify -Zmiri-seed multiple times!" ) ;
154
- }
155
- let seed_raw = hex:: decode ( & split[ 1 ] ) . unwrap ( ) ;
156
- if seed_raw. len ( ) > 8 {
157
- panic ! ( format!( "-Zmiri-seed must be at most 8 bytes, was {}" , seed_raw. len( ) ) ) ;
158
- }
159
-
160
- let mut bytes = [ 0 ; 8 ] ;
161
- bytes[ ..seed_raw. len ( ) ] . copy_from_slice ( & hex:: decode ( & split[ 1 ] ) . unwrap ( ) ) ;
162
- seed = Some ( u64:: from_be_bytes ( bytes) ) ;
163
- } else {
164
- rustc_args. push ( arg) ;
149
+ arg if arg. starts_with ( "-Zmiri-seed=" ) => {
150
+ if seed. is_some ( ) {
151
+ panic ! ( "Cannot specify -Zmiri-seed multiple times!" ) ;
152
+ }
153
+ let seed_raw = hex:: decode ( arg. trim_start_matches ( "-Zmiri-seed=" ) ) . unwrap ( ) ;
154
+ if seed_raw. len ( ) > 8 {
155
+ panic ! ( format!( "-Zmiri-seed must be at most 8 bytes, was {}" , seed_raw. len( ) ) ) ;
165
156
}
157
+
158
+ let mut bytes = [ 0 ; 8 ] ;
159
+ bytes[ ..seed_raw. len ( ) ] . copy_from_slice ( & seed_raw) ;
160
+ seed = Some ( u64:: from_be_bytes ( bytes) ) ;
161
+
162
+ } ,
163
+ _ => {
164
+ rustc_args. push ( arg) ;
166
165
}
167
166
}
168
167
}
You can’t perform that action at this time.
0 commit comments