Simplify implementation of #[serde(default=...)]

This commit is contained in:
David Tolnay
2016-06-09 23:21:42 -07:00
parent bb059b97c0
commit 3119cc8857
4 changed files with 35 additions and 43 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ fn build_impl_generics(
// serialized by us so we do not generate a bound. Fields with a `bound`
// attribute specify their own bound so we do not generate one. All other fields
// may need a `T: Serialize` bound where T is the type of the field.
fn needs_serialize_bound(_: &ast::StructField, attrs: &attr::FieldAttrs) -> bool {
fn needs_serialize_bound(attrs: &attr::FieldAttrs) -> bool {
!attrs.skip_serializing_field()
&& attrs.serialize_with().is_none()
&& attrs.ser_bound().is_none()