| 1 | use proc_macro2::Span; |
| 2 | use syn::Variant; |
| 3 | |
| 4 | #[inline] |
| 5 | pub(crate) fn multiple_deref_fields(span: Span) -> syn::Error { |
| 6 | syn::Error::new(span, "multiple fields are set for `Deref`") |
| 7 | } |
| 8 | |
| 9 | #[inline] |
| 10 | pub(crate) fn multiple_deref_fields_of_variant(span: Span, variant: &Variant) -> syn::Error { |
| 11 | syn::Error::new( |
| 12 | span, |
| 13 | format!("multiple fields of the `{}` variant are set for `Deref`", variant.ident), |
| 14 | ) |
| 15 | } |
| 16 | |
| 17 | #[inline] |
| 18 | pub(crate) fn no_deref_field(span: Span) -> syn::Error { |
| 19 | syn::Error::new(span, "there is no field which is assigned for `Deref`") |
| 20 | } |
| 21 | |
| 22 | #[inline] |
| 23 | pub(crate) fn no_deref_field_of_variant(span: Span, variant: &Variant) -> syn::Error { |
| 24 | syn::Error::new( |
| 25 | span, |
| 26 | format!( |
| 27 | "there is no field for the `{}` variant which is assigned for `Deref`", |
| 28 | variant.ident |
| 29 | ), |
| 30 | ) |
| 31 | } |