File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -245,27 +245,24 @@ mod tests {
245245 #[ test]
246246 fn test_invalid_missing_quotes ( ) {
247247 let input = "foo" ;
248- match json:: parse ( input) {
249- Ok ( _) => panic ! ( "Should have failed" ) ,
250- Err ( _) => { }
248+ if json:: parse ( input) . is_ok ( ) {
249+ panic ! ( "Should have failed" ) ;
251250 }
252251 }
253252
254253 #[ test]
255254 fn test_unterminated_string ( ) {
256255 let input = r#""unterminated"# ;
257- match json:: parse ( input) {
258- Ok ( _) => panic ! ( "Should have failed" ) ,
259- Err ( _) => { }
256+ if json:: parse ( input) . is_ok ( ) {
257+ panic ! ( "Should have failed" ) ;
260258 }
261259 }
262260
263261 #[ test]
264262 fn test_invalid_escape ( ) {
265263 let input = r#""bad\q""# ;
266- match json:: parse ( input) {
267- Ok ( _) => panic ! ( "Should have failed" ) ,
268- Err ( _) => { }
264+ if json:: parse ( input) . is_ok ( ) {
265+ panic ! ( "Should have failed" ) ;
269266 }
270267 }
271268}
You can’t perform that action at this time.
0 commit comments