mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
simplified write
This commit is contained in:
@@ -1098,13 +1098,11 @@ fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
||||
write!(f, "fn(")?;
|
||||
for index in 0..parameters.len() - 1 {
|
||||
let (param_name, param_type) = ¶meters[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 {
|
||||
|
||||
Reference in New Issue
Block a user