removed unwrap

This commit is contained in:
Jeroen Vannevel 2022-02-15 14:58:06 +00:00
parent 0a80cc82b1
commit e1df78820e
No known key found for this signature in database
GPG Key ID: 78EF5F52F38C49BD

View File

@ -1115,12 +1115,13 @@ impl HirDisplay for TypeRef {
write!(f, "{}...", if parameters.len() == 1 { "" } else { ", " })?;
}
write!(f, ")")?;
let ret_ty = &parameters.last().unwrap().1;
match ret_ty {
TypeRef::Tuple(tup) if tup.is_empty() => {}
_ => {
write!(f, " -> ")?;
ret_ty.hir_fmt(f)?;
if let Some((_, ret_ty)) = &parameters.last() {
match ret_ty {
TypeRef::Tuple(tup) if tup.is_empty() => {}
_ => {
write!(f, " -> ")?;
ret_ty.hir_fmt(f)?;
}
}
}
}