From df4ad5884d78ca86f1de8d95f58aed7a510cb9de Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Mon, 21 Aug 2023 09:44:03 +0200 Subject: [PATCH] Fix: Use `&[T]` instead of `&Vec` --- serde_derive/src/ser.rs | 2 +- test_suite/tests/test_gen.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serde_derive/src/ser.rs b/serde_derive/src/ser.rs index a2cab263..3be51ee5 100644 --- a/serde_derive/src/ser.rs +++ b/serde_derive/src/ser.rs @@ -710,7 +710,7 @@ fn serialize_adjacently_tagged_variant( }); let fields_ty = variant.fields.iter().map(|f| &f.ty); - let fields_ident: &Vec<_> = &match variant.style { + let fields_ident: &[_] = &match variant.style { Style::Unit => { if variant.attrs.serialize_with().is_some() { vec![] diff --git a/test_suite/tests/test_gen.rs b/test_suite/tests/test_gen.rs index 02354f3c..9a7c99e7 100644 --- a/test_suite/tests/test_gen.rs +++ b/test_suite/tests/test_gen.rs @@ -843,7 +843,7 @@ pub fn is_zero(n: &u8) -> bool { *n == 0 } -fn vec_first_element(vec: &Vec, serializer: S) -> StdResult +fn vec_first_element(vec: &[T], serializer: S) -> StdResult where T: Serialize, S: Serializer,