File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -243,9 +243,9 @@ pub fn generate_report<DB: ReadResults>(
243
243
} )
244
244
} ) ;
245
245
// Convert errors to Nones
246
- let mut crate_results = crate_results. map ( |r| r. ok ( ) ) . collect :: < Vec < _ > > ( ) ;
247
- let crate2 = crate_results. pop ( ) . unwrap ( ) ;
248
- let crate1 = crate_results. pop ( ) . unwrap ( ) ;
246
+ let mut crate_results = crate_results. map ( |r| r. ok ( ) ) ;
247
+ let crate1 = crate_results. next ( ) . unwrap ( ) ;
248
+ let crate2 = crate_results. next ( ) . unwrap ( ) ;
249
249
let comp = compare (
250
250
config,
251
251
krate,
Original file line number Diff line number Diff line change @@ -125,18 +125,20 @@ macro_rules! test_result_enum {
125
125
126
126
fn from_str( input: & str ) -> Fallible <Self > {
127
127
// if there is more than one ':' we assume it's part of a failure reason serialization
128
- let parts: Vec <& str > = input. splitn( 2 , ':' ) . collect( ) ;
128
+ let mut parts = input. splitn( 2 , ':' ) ;
129
+ let part1 = parts. next( ) . unwrap( ) ;
130
+ let part2 = parts. next( ) ;
129
131
130
- if parts . len ( ) == 1 {
131
- match parts [ 0 ] {
132
+ if part2 . is_none ( ) {
133
+ match part1 {
132
134
$( $with_reason_repr => Ok ( $name:: $with_reason_name( $reason:: Unknown ) ) , ) *
133
135
$( $reasonless_repr => Ok ( $name:: $reasonless_name) , ) *
134
136
other => Err ( TestResultParseError :: UnknownResult ( other. into( ) ) . into( ) ) ,
135
137
}
136
138
} else {
137
- match parts [ 0 ] {
139
+ match part1 {
138
140
$( $reasonless_repr => Err ( TestResultParseError :: UnexpectedFailureReason . into( ) ) , ) *
139
- $( $with_reason_repr => Ok ( $name:: $with_reason_name( parts [ 1 ] . parse( ) ?) ) , ) *
141
+ $( $with_reason_repr => Ok ( $name:: $with_reason_name( part2 . unwrap ( ) . parse( ) ?) ) , ) *
140
142
other => Err ( TestResultParseError :: UnknownResult ( other. into( ) ) . into( ) ) ,
141
143
}
142
144
}
You can’t perform that action at this time.
0 commit comments