Skip to content

Commit b539d5a

Browse files
committed
Use let-else syntax to reduce indentation in fuzz
1 parent 455ca39 commit b539d5a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fuzz/fuzz_targets/parse_token_stream.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ fn main() {
5959
}
6060

6161
fn do_fuzz(bytes: &[u8]) {
62-
if bytes.len() < 200 {
63-
if let Ok(string) = str::from_utf8(bytes) {
64-
_ = string.parse::<proc_macro2::TokenStream>();
65-
}
66-
}
62+
let ..=199 = bytes.len() else { return };
63+
let Ok(string) = str::from_utf8(bytes) else { return };
64+
let _ = string.parse::<proc_macro2::TokenStream>();
6765
}

0 commit comments

Comments
 (0)