Skip to content

Commit

Permalink
Fix: Use &[T] instead of &Vec<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzaaft committed Aug 21, 2023
1 parent 3c7dd6f commit df4ad58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion serde_derive/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![]
Expand Down
2 changes: 1 addition & 1 deletion test_suite/tests/test_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ pub fn is_zero(n: &u8) -> bool {
*n == 0
}

fn vec_first_element<T, S>(vec: &Vec<T>, serializer: S) -> StdResult<S::Ok, S::Error>
fn vec_first_element<T, S>(vec: &[T], serializer: S) -> StdResult<S::Ok, S::Error>
where
T: Serialize,
S: Serializer,
Expand Down

0 comments on commit df4ad58

Please sign in to comment.