Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use &[T] instead of &Vec<T> wherever possible #2594

Merged
merged 1 commit into from Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion serde_derive/src/ser.rs
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
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