if subexpr_list.is_empty() {
""
} else if extend || subexpr_list.last().map_or(false, is_try) ||
- is_extendable_parent(context, parent_str)
+ is_extendable_parent(context, parent_str)
{
// 1 = ";", being conservative here.
if last_line_width(parent_str) + first_line_width(first_child_str) + 1 <=
CommentStyle::DoubleSlash
}
} else if (orig.starts_with("///") && orig.chars().nth(3).map_or(true, |c| c != '/')) ||
- (orig.starts_with("/**") && !orig.starts_with("/**/"))
+ (orig.starts_with("/**") && !orig.starts_with("/**/"))
{
CommentStyle::TripleSlash
} else if orig.starts_with("//!") || orig.starts_with("/*!") {
&line[opener.trim_right().len()..]
}
} else if line.starts_with("/* ") || line.starts_with("// ") || line.starts_with("//!") ||
- line.starts_with("///") ||
- line.starts_with("** ") || line.starts_with("/*!") ||
- (line.starts_with("/**") && !line.starts_with("/**/"))
+ line.starts_with("///") ||
+ line.starts_with("** ") || line.starts_with("/*!") ||
+ (line.starts_with("/**") && !line.starts_with("/**/"))
{
&line[3..]
} else if line.starts_with("/*") || line.starts_with("* ") || line.starts_with("//") ||
- line.starts_with("**")
+ line.starts_with("**")
{
&line[2..]
} else if line.starts_with('*') {
} else if comment.starts_with("//") {
&comment[2..]
} else if (comment.starts_with("/**") && !comment.starts_with("/**/")) ||
- comment.starts_with("/*!")
+ comment.starts_with("/*!")
{
&comment[3..comment.len() - 2]
} else {
}
// Try rewriting the rhs into the remaining space.
- let rhs_shape = shape.shrink_left(last_line_width(&result) + suffix.len());
+ let rhs_shape = shape.offset_left(last_line_width(&result) + suffix.len());
if let Some(rhs_shape) = rhs_shape {
if let Some(rhs_result) = rhs.rewrite(context, rhs_shape) {
// FIXME this should always hold.
// 1 = |
let argument_offset = nested_shape.indent + 1;
- let arg_shape = try_opt!(nested_shape.shrink_left(1)).visual_indent(0);
+ let arg_shape = try_opt!(nested_shape.offset_left(1)).visual_indent(0);
let ret_str = try_opt!(fn_decl.output.rewrite(context, arg_shape));
let arg_items = itemize_list(
let constr_shape = if self.nested_if {
// We are part of an if-elseif-else chain. Our constraints are tightened.
// 7 = "} else " .len()
- try_opt!(shape.shrink_left(7))
+ try_opt!(shape.offset_left(7))
} else {
shape
};
let block_sep = if self.cond.is_none() && between_kwd_cond_comment.is_some() {
""
} else if context.config.control_brace_style() == ControlBraceStyle::AlwaysNextLine ||
- force_newline_brace
+ force_newline_brace
{
alt_block_sep
} else {
}
StructLitField::Base(expr) => {
// 2 = ..
- expr.rewrite(context, try_opt!(v_shape.shrink_left(2)))
+ expr.rewrite(context, try_opt!(v_shape.offset_left(2)))
.map(|s| format!("..{}", s))
}
};
if force_newline_brace {
newline_brace = true;
} else if self.config.fn_brace_style() != BraceStyle::AlwaysNextLine &&
- !result.contains('\n')
+ !result.contains('\n')
{
newline_brace = false;
}
{
ha();
} else if xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +
- xxxxxxxxx
+ xxxxxxxxx
{
yo();
}
condition__uses_alignment_for_first_if__2
{
} else if condition__no_alignment_for_later_else__0 ||
- condition__no_alignment_for_later_else__1 ||
- condition__no_alignment_for_later_else__2
+ condition__no_alignment_for_later_else__1 ||
+ condition__no_alignment_for_later_else__2
{
};
}