From ff0a0a58590e9c12c1a2fe7d4dcb1d96e06eba26 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 19 Oct 2023 10:50:31 -0700 Subject: [PATCH] Source and From attributes only have single-ident path --- impl/src/prop.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/impl/src/prop.rs b/impl/src/prop.rs index 5a6a6bc..2867cd3 100644 --- a/impl/src/prop.rs +++ b/impl/src/prop.rs @@ -1,7 +1,6 @@ use crate::ast::{Enum, Field, Struct, Variant}; use crate::span::MemberSpan; use proc_macro2::Span; -use syn::spanned::Spanned; use syn::{Member, Type}; impl Struct<'_> { @@ -76,9 +75,9 @@ impl Field<'_> { pub(crate) fn source_span(&self) -> Span { if let Some(source_attr) = &self.attrs.source { - source_attr.path().span() + source_attr.path().get_ident().unwrap().span() } else if let Some(from_attr) = &self.attrs.from { - from_attr.path().span() + from_attr.path().get_ident().unwrap().span() } else { self.member.member_span() }