From d86e8c86830d42f11d1cc5083cab9a00759fda17 Mon Sep 17 00:00:00 2001 From: Marshall Pierce <575695+marshallpierce@users.noreply.github.com> Date: Sat, 10 Dec 2022 11:38:43 -0700 Subject: [PATCH 1/2] Update to edition 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 06fdd5c..208e103 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" keywords = ["base64", "utf8", "encode", "decode", "no_std"] categories = ["encoding"] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" rust-version = "1.57.0" [[bench]] From f58f44168920b008d14de437b39a87d0f520f1d6 Mon Sep 17 00:00:00 2001 From: Marshall Pierce <575695+marshallpierce@users.noreply.github.com> Date: Sat, 10 Dec 2022 11:49:31 -0700 Subject: [PATCH 2/2] Also updated fuzzers --- fuzz/Cargo.toml | 1 + fuzz/fuzzers/decode_random.rs | 2 +- fuzz/fuzzers/roundtrip.rs | 2 +- fuzz/fuzzers/roundtrip_no_pad.rs | 2 +- fuzz/fuzzers/roundtrip_random_config.rs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index ec3324b..3cd260e 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -4,6 +4,7 @@ name = "base64-fuzz" version = "0.0.1" authors = ["Automatically generated"] publish = false +edition = "2021" [package.metadata] cargo-fuzz = true diff --git a/fuzz/fuzzers/decode_random.rs b/fuzz/fuzzers/decode_random.rs index 0c0d962..5769578 100644 --- a/fuzz/fuzzers/decode_random.rs +++ b/fuzz/fuzzers/decode_random.rs @@ -11,5 +11,5 @@ fuzz_target!(|data: &[u8]| { // The data probably isn't valid base64 input, but as long as it returns an error instead // of crashing, that's correct behavior. - let _ = decode_engine(&data, &engine); + let _ = decode_engine(data, &engine); }); diff --git a/fuzz/fuzzers/roundtrip.rs b/fuzz/fuzzers/roundtrip.rs index 2097f2a..8b0a98b 100644 --- a/fuzz/fuzzers/roundtrip.rs +++ b/fuzz/fuzzers/roundtrip.rs @@ -5,7 +5,7 @@ extern crate base64; use base64::engine::DEFAULT_ENGINE; fuzz_target!(|data: &[u8]| { - let encoded = base64::encode_engine(&data, &DEFAULT_ENGINE); + let encoded = base64::encode_engine(data, &DEFAULT_ENGINE); let decoded = base64::decode_engine(&encoded, &DEFAULT_ENGINE).unwrap(); assert_eq!(data, decoded.as_slice()); }); diff --git a/fuzz/fuzzers/roundtrip_no_pad.rs b/fuzz/fuzzers/roundtrip_no_pad.rs index d5ff485..def2ebb 100644 --- a/fuzz/fuzzers/roundtrip_no_pad.rs +++ b/fuzz/fuzzers/roundtrip_no_pad.rs @@ -11,7 +11,7 @@ fuzz_target!(|data: &[u8]| { .with_decode_padding_mode(engine::DecodePaddingMode::RequireNone); let engine = fast_portable::FastPortable::from(&base64::alphabet::STANDARD, config); - let encoded = base64::encode_engine(&data, &engine); + let encoded = base64::encode_engine(data, &engine); let decoded = base64::decode_engine(&encoded, &engine).unwrap(); assert_eq!(data, decoded.as_slice()); }); diff --git a/fuzz/fuzzers/roundtrip_random_config.rs b/fuzz/fuzzers/roundtrip_random_config.rs index 1f5a2c1..55d7465 100644 --- a/fuzz/fuzzers/roundtrip_random_config.rs +++ b/fuzz/fuzzers/roundtrip_random_config.rs @@ -9,7 +9,7 @@ mod utils; fuzz_target!(|data: &[u8]| { let engine = utils::random_engine(data); - let encoded = encode_engine(&data, &engine); + let encoded = encode_engine(data, &engine); let decoded = decode_engine(&encoded, &engine).unwrap(); assert_eq!(data, decoded.as_slice()); });