feat(codegen): Detect repeated struct field when deserializing

This commit is contained in:
David Tolnay committed 2016-05-10 09:52:51 -07:00
1 parent 7aa0b6ce27
commit eeb4efc19c
4 files changed
+49

No files matched your search

+6
View File
@@ -46,6 +46,12 @@ pub trait Error: Sized + error::Error {
fn missing_field(field: &'static str) -> Self {
Error::custom(format!("Missing field `{}`", field))
}
/// Raised when a `Deserialize` struct type received more than one of the
/// same struct field.
fn duplicate_field(field: &'static str) -> Self {
Error::custom(format!("Duplicate field `{}`", field))
}
}
/// `Type` represents all the primitive types that can be deserialized. This is used by