File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ fn serialize_fields(fields: &[parse::Field], offset: usize) -> Vec<proc_macro2::
52
52
}
53
53
} ) ,
54
54
Skip :: Always => None ,
55
- Skip :: None => Some ( quote ! {
55
+ Skip :: Never => Some ( quote ! {
56
56
map. serialize_entry( & #index, & self . #member) ?;
57
57
} ) ,
58
58
}
@@ -72,7 +72,7 @@ fn count_serialized_fields(fields: &[parse::Field]) -> Vec<proc_macro2::TokenStr
72
72
}
73
73
Skip :: Always => quote ! { 0 } ,
74
74
75
- Skip :: None => {
75
+ Skip :: Never => {
76
76
quote ! { 1 }
77
77
}
78
78
}
@@ -133,7 +133,7 @@ fn unwrap_expected_fields(fields: &[parse::Field]) -> Vec<proc_macro2::TokenStre
133
133
let label = field. label . clone ( ) ;
134
134
let ident = format_ident ! ( "{}" , & field. label) ;
135
135
match field. skip_serializing_if {
136
- Skip :: None => quote ! {
136
+ Skip :: Never => quote ! {
137
137
let #ident = #ident. ok_or_else( || serde:: de:: Error :: missing_field( #label) ) ?;
138
138
} ,
139
139
Skip :: If ( _) => quote ! {
Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ pub struct StructAttrs {
17
17
}
18
18
19
19
pub enum Skip {
20
- None ,
20
+ Never ,
21
21
If ( syn:: ExprPath ) ,
22
22
Always ,
23
23
}
24
24
25
25
impl Skip {
26
26
pub fn is_none ( & self ) -> bool {
27
- matches ! ( self , Self :: None )
27
+ matches ! ( self , Self :: Never )
28
28
}
29
29
pub fn is_always ( & self ) -> bool {
30
30
matches ! ( self , Self :: Always )
@@ -114,7 +114,7 @@ fn fields_from_ast(
114
114
let current_index = index;
115
115
index += 1 ;
116
116
117
- let mut skip_serializing_if = Skip :: None ;
117
+ let mut skip_serializing_if = Skip :: Never ;
118
118
for attr in & field. attrs {
119
119
if attr. path ( ) . is_ident ( "serde" ) {
120
120
attr. parse_nested_meta ( |meta| {
You can’t perform that action at this time.
0 commit comments