Skip to content

Commit e52b7b3

Browse files
committed
Touch up PR 2567
1 parent 84c7419 commit e52b7b3

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

serde_derive/src/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ fn prepare_enum_variant_enum(variants: &[Variant]) -> (TokenStream, Stmts) {
12681268

12691269
let variant_visitor = Stmts(deserialize_generated_identifier(
12701270
&variant_names_idents,
1271-
false, // variant identifiers does not depend on the presence of flatten fields
1271+
false, // variant identifiers do not depend on the presence of flatten fields
12721272
true,
12731273
None,
12741274
fallthrough,
@@ -2708,7 +2708,7 @@ fn deserialize_map_in_place(
27082708
) -> Fragment {
27092709
assert!(
27102710
!cattrs.has_flatten(),
2711-
"inplace deserialization of maps doesn't support flatten fields"
2711+
"inplace deserialization of maps does not support flatten fields"
27122712
);
27132713

27142714
// Create the field names for the fields.

serde_derive/src/internals/attr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ pub struct Container {
216216
type_into: Option<syn::Type>,
217217
remote: Option<syn::Path>,
218218
identifier: Identifier,
219-
/// `true` if container is a `struct` and it has a field with `#[serde(flatten)]`
220-
/// attribute or it is an `enum` with a struct variant which has a field with
221-
/// `#[serde(flatten)]` attribute. Examples:
219+
/// True if container is a struct and has a field with `#[serde(flatten)]`,
220+
/// or is an enum with a struct variant which has a field with
221+
/// `#[serde(flatten)]`.
222222
///
223223
/// ```ignore
224224
/// struct Container {
@@ -810,8 +810,8 @@ pub struct Variant {
810810
rename_all_rules: RenameAllRules,
811811
ser_bound: Option<Vec<syn::WherePredicate>>,
812812
de_bound: Option<Vec<syn::WherePredicate>>,
813-
/// `true` if variant is a struct variant which contains a field with `#[serde(flatten)]`
814-
/// attribute. Examples:
813+
/// True if variant is a struct variant which contains a field with
814+
/// `#[serde(flatten)]`.
815815
///
816816
/// ```ignore
817817
/// enum Enum {

test_suite/tests/regression/issue1904.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(dead_code)] // we do not read enum fields
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]

test_suite/tests/regression/issue2792.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(dead_code)] // we do not read enum fields
2+
23
use serde_derive::Deserialize;
34

45
#[derive(Deserialize)]
@@ -12,5 +13,6 @@ pub enum A {
1213
e: E,
1314
},
1415
}
16+
1517
#[derive(Deserialize)]
1618
pub struct E {}

0 commit comments

Comments
 (0)