From 03e77b3d2b2d108c044d28601617a087b16c79b5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 12 Oct 2019 16:53:23 -0700 Subject: [PATCH] Treat the #[from] field implicitly as source --- impl/src/prop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/src/prop.rs b/impl/src/prop.rs index 56b6108..a024833 100644 --- a/impl/src/prop.rs +++ b/impl/src/prop.rs @@ -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); } }