From 1f4f26a23d1eb9d6a50384867af22609205f37c8 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 16 Feb 2025 23:59:46 +0100 Subject: [PATCH] Remove unused fields and lifetimes This fixes some compiler warnings and clippy lints. --- src/parse.rs | 5 ----- tests/basics.rs | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/parse.rs b/src/parse.rs index 5e341e3..5528fce 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -21,9 +21,6 @@ pub struct Field { pub member: syn::Member, pub index: usize, pub skip_serializing_if: Option, - // pub attrs: attr::Field, - pub ty: syn::Type, - pub original: syn::Field, } fn parse_meta(attrs: &mut StructAttrs, meta: ParseNestedMeta) -> Result<()> { @@ -143,8 +140,6 @@ fn fields_from_ast( } skip_serializing_if }, - ty: field.ty.clone(), - original: field.clone(), }) }) .collect() diff --git a/tests/basics.rs b/tests/basics.rs index 59a90a3..d20dc15 100644 --- a/tests/basics.rs +++ b/tests/basics.rs @@ -240,7 +240,7 @@ mod cow { } } - const SERIALIZED_LIFETIME_EXAMPLE: &'static [u8] = b"\xa1\x01\x83\x01\x02\x03"; + const SERIALIZED_LIFETIME_EXAMPLE: &[u8] = b"\xa1\x01\x83\x01\x02\x03"; #[test] fn serialize() { @@ -261,7 +261,7 @@ mod cow { assert_eq!(deserialized, example); let Cow::Owned(_) = deserialized.data else { - panic!("Expected deserialized data Cow::Owned"); - }; + panic!("Expected deserialized data Cow::Owned"); + }; } }