Update compiler/fmt/src/def.rs

This commit is contained in:
Richard Feldman 2020-11-08 22:11:38 -05:00 committed by GitHub
parent 65c1e0e5b1
commit ef90103353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ impl<'a> Formattable<'a> for Def<'a> {
loc_pattern.is_multiline() || loc_annotation.is_multiline()
}
Body(loc_pattern, loc_expr) => loc_pattern.is_multiline() || loc_expr.is_multiline(),
AnnotatedBody { .. } => true, // Sebbes: not really sure here...
AnnotatedBody { .. } => true,
SpaceBefore(sub_def, spaces) | SpaceAfter(sub_def, spaces) => {
spaces.iter().any(|s| is_comment(s)) || sub_def.is_multiline()
}