Fix the problem described in
@@ -10,10 +10,10 @@ pub enum OutputType<'a> {
impl<'a> OutputType<'a> {
pub fn parse(input: &'a Type) -> Result<Self> {
let ty = if let Type::Path(p) = input {
- if p.path.segments.last().unwrap().ident == "Result"
- || p.path.segments.last().unwrap().ident == "FieldResult"
+ if p.path.segments.last().unwrap().ident == "FieldResult" {
+ if let PathArguments::AngleBracketed(args) =
+ &p.path.segments.last().unwrap().arguments
{
- if let PathArguments::AngleBracketed(args) = &p.path.segments[0].arguments {
if args.args.is_empty() {
return Err(Error::new_spanned(input, "Invalid type"));
}
