]> git.bitcoin.ninja Git - rust-lightning/commitdiff
`rustfmt`: `fuzz/src/base32.rs`
authorElias Rohrer <dev@tnull.de>
Thu, 6 Jun 2024 10:31:41 +0000 (12:31 +0200)
committerElias Rohrer <dev@tnull.de>
Fri, 7 Jun 2024 18:37:09 +0000 (20:37 +0200)
fuzz/src/base32.rs
rustfmt_excluded_files

index 8171f19f637a00fc9fc18144d12ab4ebff699e54..c0d71dd7b3300edbc4638520ad71471a3ecdd90a 100644 (file)
@@ -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);
 }
 
index 36d85ef2061b4056d24c268ec3d1157cc9f5a574..8338788aecd564819271ab80f217e3e143b72c8d 100644 (file)
@@ -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