Function rustfmt_nightly::expr::prefer_next_line
source · pub(crate) fn prefer_next_line(
orig_rhs: &str,
next_line_rhs: &str,
rhs_tactics: RhsTactics
) -> bool
Expand description
Returns true if formatting next_line_rhs is better on a new line when compared to the original’s line formatting.
It is considered better if:
- the tactic is ForceNextLineWithoutIndent
- next_line_rhs doesn’t have newlines
- the original line has more newlines than next_line_rhs
- the original formatting of the first line ends with
(
,{
, or[
and next_line_rhs doesn’t