Skip to content

Commit

Permalink
Merge pull request #2594 from Uzaaft/master
Browse files Browse the repository at this point in the history
Fix: Use `&[T]` instead of `&Vec<T>` wherever possible
  • Loading branch information
dtolnay authored Aug 23, 2023
2 parents fc04d12 + df4ad58 commit e797c90
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 e797c90

Please sign in to comment.