File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -125,22 +125,21 @@ macro_rules! test_result_enum {
125
125
type Err = :: failure:: Error ;
126
126
127
127
fn from_str( input: & str ) -> Fallible <Self > {
128
- let parts: Vec <& str > = input. split( ':' ) . collect( ) ;
128
+ // if there is more than one ':' we assume it's part of a failure reason serialization
129
+ let parts: Vec <& str > = input. splitn( 2 , ':' ) . collect( ) ;
129
130
130
131
if parts. len( ) == 1 {
131
132
match parts[ 0 ] {
132
133
$( $with_reason_repr => Ok ( $name:: $with_reason_name( $reason:: Unknown ) ) , ) *
133
134
$( $reasonless_repr => Ok ( $name:: $reasonless_name) , ) *
134
135
other => Err ( TestResultParseError :: UnknownResult ( other. into( ) ) . into( ) ) ,
135
136
}
136
- } else if parts . len ( ) == 2 {
137
+ } else {
137
138
match parts[ 0 ] {
138
139
$( $reasonless_repr => Err ( TestResultParseError :: UnexpectedFailureReason . into( ) ) , ) *
139
140
$( $with_reason_repr => Ok ( $name:: $with_reason_name( parts[ 1 ] . parse( ) ?) ) , ) *
140
141
other => Err ( TestResultParseError :: UnknownResult ( other. into( ) ) . into( ) ) ,
141
142
}
142
- } else {
143
- Err ( TestResultParseError :: TooManySegments . into( ) )
144
143
}
145
144
}
146
145
}
@@ -162,8 +161,6 @@ pub enum TestResultParseError {
162
161
UnknownResult ( String ) ,
163
162
#[ fail( display = "unexpected failure reason" ) ]
164
163
UnexpectedFailureReason ,
165
- #[ fail( display = "too many segments" ) ]
166
- TooManySegments ,
167
164
}
168
165
169
166
// simplified and lighter version of cargo-metadata::diagnostic::DiagnosticCode
Original file line number Diff line number Diff line change 31
31
},
32
32
{
33
33
"log" : " stable%2Brustflags=-Dclippy::all/local/clippy-warn" ,
34
- "res" : " build-fail:unknown "
34
+ "res" : " build-fail:compiler-error(clippy::print_with_newline) "
35
35
}
36
36
],
37
37
"url" : " https://github.com/rust-lang/crater/tree/master/local-crates/clippy-warn"
You can’t perform that action at this time.
0 commit comments