Fix the problem described in #80
This commit is contained in:
parent
352f9e44af
commit
a4a92dcb8c
|
@ -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 let PathArguments::AngleBracketed(args) = &p.path.segments[0].arguments {
|
||||
if p.path.segments.last().unwrap().ident == "FieldResult" {
|
||||
if let PathArguments::AngleBracketed(args) =
|
||||
&p.path.segments.last().unwrap().arguments
|
||||
{
|
||||
if args.args.is_empty() {
|
||||
return Err(Error::new_spanned(input, "Invalid type"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user