Skip to content

Commit ef4ac25

Browse files
author
Joe Chung
committed
Address clippy feedback
1 parent 3f4387e commit ef4ac25

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

shared-lib/src/string.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)