ForeignItem(&'a ast::ForeignItem),
}
-impl BodyElement<'_> {
- pub(crate) fn span(&self) -> Span {
- match self {
- BodyElement::ForeignItem(fi) => fi.span(),
- }
- }
-}
-
/// Represents a fn's signature.
pub(crate) struct FnSig<'a> {
decl: &'a ast::FnDecl,
self.block_indent = self.block_indent.block_indent(self.config);
if !item.body.is_empty() {
- // Advance to first item (statement or inner attribute)
- // within the block.
- self.last_pos = item.body[0].span().lo();
for item in &item.body {
self.format_body_element(item);
}
result.push_str(&where_clause_str);
force_new_line_for_brace |= last_line_contains_single_line_comment(&result);
- force_new_line_for_brace |= is_params_multi_lined && context.config.where_single_line();
+ force_new_line_for_brace |=
+ is_params_multi_lined && context.config.where_single_line() && !where_clause_str.is_empty();
Some((result, force_new_line_for_brace))
}