Treat the #[from] field implicitly as source

This commit is contained in:
David Tolnay 2019-10-12 16:53:23 -07:00
parent 2305f75976
commit 03e77b3d2b
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -45,7 +45,7 @@ impl Variant<'_> {
fn source_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> {
for field in fields {
if field.attrs.source.is_some() {
if field.attrs.from.is_some() || field.attrs.source.is_some() {
return Some(&field);
}
}