Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl Rewrite for ChainItem {
ChainItemKind::Parent {
ref expr,
parens: true,
} => crate::expr::rewrite_paren(context, &expr, shape, expr.span)?,
} => crate::expr::rewrite_paren(context, expr, shape, expr.span)?,
ChainItemKind::Parent {
ref expr,
parens: false,
Expand Down Expand Up @@ -367,7 +367,7 @@ impl ChainItem {
format!("::<{}>", type_list.join(", "))
};
let callee_str = format!(".{}{}", rewrite_ident(context, method_name), type_str);
rewrite_call(context, &callee_str, &args, span, shape)
rewrite_call(context, &callee_str, args, span, shape)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ fn choose_rhs<R: Rewrite>(

match (orig_rhs, new_rhs) {
(Ok(ref orig_rhs), Ok(ref new_rhs))
if !filtered_str_fits(&new_rhs, context.config.max_width(), new_shape) =>
if !filtered_str_fits(new_rhs, context.config.max_width(), new_shape) =>
{
Ok(format!("{before_space_str}{orig_rhs}"))
}
Expand Down
2 changes: 1 addition & 1 deletion src/format_report_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'a> Display for FormatReportFormatter<'a> {

let message_suffix = error.msg_suffix();
if !message_suffix.is_empty() {
message = message.footer(Level::Note.title(&message_suffix));
message = message.footer(Level::Note.title(message_suffix));
}

let origin = format!("{}:{}", file, error.line);
Expand Down
6 changes: 3 additions & 3 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ fn rewrite_ty<R: Rewrite>(
let option = WhereClauseOption::new(true, WhereClauseSpace::Newline);
let after_where_clause_str = rewrite_where_clause(
context,
&after_where_clause,
after_where_clause,
context.config.brace_style(),
Shape::indented(indent, context.config),
false,
Expand Down Expand Up @@ -2489,7 +2489,7 @@ fn rewrite_fn_base(
let generics_str = rewrite_generics(
context,
rewrite_ident(context, ident),
&fn_sig.generics,
fn_sig.generics,
shape,
)?;
result.push_str(&generics_str);
Expand Down Expand Up @@ -2734,7 +2734,7 @@ fn rewrite_fn_base(
}
let where_clause_str = rewrite_where_clause(
context,
&where_clause,
where_clause,
context.config.brace_style(),
Shape::indented(indent, context.config),
true,
Expand Down
4 changes: 2 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ impl MacroArgParser {

// Parse '*', '+' or '?.
for tok in iter {
self.set_last_tok(&tok);
self.set_last_tok(tok);
if first {
first = false;
}
Expand Down Expand Up @@ -970,7 +970,7 @@ impl MacroArgParser {
}
}

self.set_last_tok(&tok);
self.set_last_tok(tok);
}

// We are left with some stuff in the buffer. Since there is nothing
Expand Down
2 changes: 1 addition & 1 deletion src/overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ impl<'a> Context<'a> {

if tactic == DefinitiveListTactic::Vertical {
if let Some((all_simple, num_args_before)) =
maybe_get_args_offset(self.ident, &self.items, &self.context.config)
maybe_get_args_offset(self.ident, &self.items, self.context.config)
{
let one_line = all_simple
&& definitive_tactic(
Expand Down
2 changes: 1 addition & 1 deletion src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub(crate) fn version_sort(a: &str, b: &str) -> std::cmp::Ordering {
(VersionChunk::Str(ca), VersionChunk::Str(cb))
| (VersionChunk::Str(ca), VersionChunk::Number { source: cb, .. })
| (VersionChunk::Number { source: ca, .. }, VersionChunk::Str(cb)) => {
match ca.cmp(&cb) {
match ca.cmp(cb) {
std::cmp::Ordering::Equal => {
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,14 @@ impl Rewrite for ast::WherePredicate {
let mut result = String::with_capacity(attrs_str.len() + pred_str.len() + 1);
result.push_str(&attrs_str);
let pred_start = self.span.lo();
let line_len = last_line_width(&attrs_str) + 1 + first_line_width(&pred_str);
let line_len = last_line_width(&attrs_str) + 1 + first_line_width(pred_str);
if let Some(last_attr) = self.attrs.last().filter(|last_attr| {
contains_comment(context.snippet(mk_sp(last_attr.span.hi(), pred_start)))
}) {
result = combine_strs_with_missing_comments(
context,
&result,
&pred_str,
pred_str,
mk_sp(last_attr.span.hi(), pred_start),
Shape {
width: shape.width.min(context.config.inline_attribute_width()),
Expand All @@ -525,7 +525,7 @@ impl Rewrite for ast::WherePredicate {
result.push(' ');
}
}
result.push_str(&pred_str);
result.push_str(pred_str);
}

Ok(result)
Expand Down
Loading