(input: &DeriveInput)
| 10 | use syn::{DeriveInput, GenericArgument, PathArguments, Result, Token, Type}; |
| 11 | |
| 12 | pub fn derive(input: &DeriveInput) -> TokenStream { |
| 13 | match try_expand(input) { |
| 14 | Ok(expanded) => expanded, |
| 15 | // If there are invalid attributes in the input, expand to an Error impl |
| 16 | // anyway to minimize spurious secondary errors in other code that uses |
| 17 | // this type as an Error. |
| 18 | Err(error) => fallback::expand(input, error), |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn try_expand(input: &DeriveInput) -> Result<TokenStream> { |
| 23 | let input = Input::from_syn(input)?; |
no test coverage detected