fix formating newlines

This commit is contained in:
Sébastien Besnier 2020-11-25 15:44:58 +01:00
parent 7361f62902
commit aa3ce94f86
3 changed files with 73 additions and 11 deletions

View file

@ -38,10 +38,21 @@ impl<'a> Formattable<'a> for Def<'a> {
loc_pattern.format(buf, indent);
if loc_annotation.is_multiline() {
buf.push_str(" :");
loc_annotation.format_with_options(
buf,
Parens::NotNeeded,
Newlines::Yes,
indent,
);
} else {
buf.push_str(" : ");
loc_annotation.format_with_options(
buf,
Parens::NotNeeded,
Newlines::No,
indent,
);
}
loc_annotation.format(buf, indent);
}
Alias { name, vars, ann } => {
buf.push_str(name.value);