simplified write

This commit is contained in:
Jeroen Vannevel 2022-02-15 19:27:56 +00:00
parent 842ffde43d
commit f083c86890
No known key found for this signature in database
GPG key ID: 78EF5F52F38C49BD

View file

@ -1098,13 +1098,11 @@ impl HirDisplay for TypeRef {
write!(f, "fn(")?;
for index in 0..parameters.len() - 1 {
let (param_name, param_type) = &parameters[index];
match param_name {
Some(name) => {
write!(f, "{}: ", name)?;
param_type.hir_fmt(f)?;
}
None => param_type.hir_fmt(f)?,
};
if let Some(name) = param_name {
write!(f, "{}: ", name)?;
}
param_type.hir_fmt(f)?;
// Last index contains the return type so we stop writing commas on the second-to-last index
if index != parameters.len() - 2 {