From c2abfbf5f5af42aa579bd3e3997ce347e5e106ac Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Thu, 6 Jun 2024 12:31:41 +0200 Subject: [PATCH] `rustfmt`: `fuzz/src/base32.rs` --- fuzz/src/base32.rs | 20 +++++++++++++------- rustfmt_excluded_files | 1 - 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fuzz/src/base32.rs b/fuzz/src/base32.rs index 8171f19f6..c0d71dd7b 100644 --- a/fuzz/src/base32.rs +++ b/fuzz/src/base32.rs @@ -16,9 +16,11 @@ pub fn do_test(data: &[u8]) { if let Ok(s) = std::str::from_utf8(data) { let first_decoding = base32::Alphabet::RFC4648 { padding: true }.decode(s); if let Ok(first_decoding) = first_decoding { - let encoding_response = base32::Alphabet::RFC4648 { padding: true }.encode(&first_decoding); + let encoding_response = + base32::Alphabet::RFC4648 { padding: true }.encode(&first_decoding); assert_eq!(encoding_response, s.to_ascii_uppercase()); - let second_decoding = base32::Alphabet::RFC4648 { padding: true }.decode(&encoding_response).unwrap(); + let second_decoding = + base32::Alphabet::RFC4648 { padding: true }.decode(&encoding_response).unwrap(); assert_eq!(first_decoding, second_decoding); } } @@ -26,19 +28,23 @@ pub fn do_test(data: &[u8]) { if let Ok(s) = std::str::from_utf8(data) { let first_decoding = base32::Alphabet::RFC4648 { padding: false }.decode(s); if let Ok(first_decoding) = first_decoding { - let encoding_response = base32::Alphabet::RFC4648 { padding: false }.encode(&first_decoding); + let encoding_response = + base32::Alphabet::RFC4648 { padding: false }.encode(&first_decoding); assert_eq!(encoding_response, s.to_ascii_uppercase()); - let second_decoding = base32::Alphabet::RFC4648 { padding: false }.decode(&encoding_response).unwrap(); + let second_decoding = + base32::Alphabet::RFC4648 { padding: false }.decode(&encoding_response).unwrap(); assert_eq!(first_decoding, second_decoding); } } - + let encode_response = base32::Alphabet::RFC4648 { padding: false }.encode(&data); - let decode_response = base32::Alphabet::RFC4648 { padding: false }.decode(&encode_response).unwrap(); + let decode_response = + base32::Alphabet::RFC4648 { padding: false }.decode(&encode_response).unwrap(); assert_eq!(data, decode_response); let encode_response = base32::Alphabet::RFC4648 { padding: true }.encode(&data); - let decode_response = base32::Alphabet::RFC4648 { padding: true }.decode(&encode_response).unwrap(); + let decode_response = + base32::Alphabet::RFC4648 { padding: true }.decode(&encode_response).unwrap(); assert_eq!(data, decode_response); } diff --git a/rustfmt_excluded_files b/rustfmt_excluded_files index 36d85ef20..8338788ae 100644 --- a/rustfmt_excluded_files +++ b/rustfmt_excluded_files @@ -1,5 +1,4 @@ ./bench/benches/bench.rs -./fuzz/src/base32.rs ./fuzz/src/bech32_parse.rs ./fuzz/src/bin/base32_target.rs ./fuzz/src/bin/bech32_parse_target.rs -- 2.39.5