diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 08:03:37 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 08:17:28 +0100 |
commit | 93e088f18959a95e71ec5084250b3ccd64d5340e (patch) | |
tree | bc2241ac6882cc70e5c10d4dd803572728473ccf /src/parse_assoc_type.rs | |
parent | 99a1e9f42e79a73e7ec3c08eb873d0ef271319d8 (diff) |
refactor: change x.first().unwrap() to x[0]
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)); |