}
fn is_comment(&self) -> bool {
- match self.kind {
- ChainItemKind::Comment(..) => true,
- _ => false,
- }
+ matches!(self.kind, ChainItemKind::Comment(..))
}
fn rewrite_method_call(
} else {
self.rewrites
.iter()
- .map(|rw| utils::unicode_str_width(&rw))
+ .map(|rw| utils::unicode_str_width(rw))
.sum()
} + last.tries;
let one_line_budget = if self.child_count == 1 {
shape.width
} else {
- min(shape.width, context.config.width_heuristics().chain_width)
+ min(shape.width, context.config.chain_width())
}
.saturating_sub(almost_total);
ChainItemKind::Comment(_, CommentPosition::Top) => result.push_str(&connector),
_ => result.push_str(&connector),
}
- result.push_str(&rewrite);
+ result.push_str(rewrite);
}
Some(result)