Skip to content

Commit f8b308c

Browse files
committed
mlua_derive: Fix compilation / remove "if let" guards
1 parent 8b9b727 commit f8b308c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

mlua_derive/src/userdata_impl.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ fn classify_ref_type(ty: &Type) -> Option<Type> {
7171
if ref_ty.mutability.is_none() {
7272
let lookup_name: Option<String> = match &*ref_ty.elem {
7373
Type::Path(path) => path.path.segments.last().map(|seg| seg.ident.to_string()),
74-
Type::Slice(slice) if let Type::Path(path) = &*slice.elem => {
75-
path.path.segments.last().map(|seg| format!("[{}]", seg.ident))
74+
Type::Slice(slice) => {
75+
if let Type::Path(path) = &*slice.elem {
76+
path.path.segments.last().map(|seg| format!("[{}]", seg.ident))
77+
} else {
78+
None
79+
}
7680
}
7781
_ => None,
7882
};

0 commit comments

Comments
 (0)