diff options
Diffstat (limited to 'src/parse_assoc_type.rs')
-rw-r--r-- | src/parse_assoc_type.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse_assoc_type.rs b/src/parse_assoc_type.rs index 856735d..5bc86cb 100644 --- a/src/parse_assoc_type.rs +++ b/src/parse_assoc_type.rs @@ -58,10 +58,10 @@ pub fn parse_assoc_type( if let PathSegment { ident, arguments: PathArguments::AngleBracketed(args), - } = bound.path.segments.first().unwrap() + } = &bound.path.segments[0] { if ident == "Into" && args.args.len() == 1 { - if let GenericArgument::Type(into_type) = args.args.first().unwrap() { + if let GenericArgument::Type(into_type) = &args.args[0] { // provide a better error message for type A: Into<Self::B> if iter_type(into_type).any(match_assoc_type) { return Err((into_type.span(), AssocTypeParseError::AssocTypeInBound)); |