Skip to content

Commit d239f16

Browse files
author
Alexander Glusker
committed
fixes errors in conversations
1 parent b26223f commit d239f16

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

src/expr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ pub(crate) fn format_expr(
227227
ast::ExprKind::MacCall(ref mac) => {
228228
let (rewrite, _) = rewrite_macro(mac, None, context, shape, MacroPosition::Expression);
229229
rewrite.or_else(|| {
230-
wrap_str(
231-
context.snippet(expr.span).to_owned(),
232-
context.config.max_width(),
233-
shape,
234-
)
235-
})
230+
wrap_str(
231+
context.snippet(expr.span).to_owned(),
232+
context.config.max_width(),
233+
shape,
234+
)
235+
})
236236
}
237237
ast::ExprKind::Ret(None) => Some("return".to_owned()),
238238
ast::ExprKind::Ret(Some(ref expr)) => {

src/macros.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,16 @@ fn rewrite_macro_inner(
217217
let has_comment = contains_comment(context.snippet(mac.span()));
218218
if ts.is_empty() && !has_comment {
219219
let rewrite = match style {
220-
Delimiter::Parenthesis if position == MacroPosition::Item => {
221-
Some(format!("{macro_name}();"))
222-
}
223-
Delimiter::Bracket if position == MacroPosition::Item => {
224-
Some(format!("{macro_name}[];"))
225-
}
226-
Delimiter::Parenthesis => Some(format!("{macro_name}()")),
227-
Delimiter::Bracket => Some(format!("{macro_name}[]")),
228-
Delimiter::Brace => Some(format!("{macro_name} {{}}")),
229-
_ => unreachable!(),
220+
Delimiter::Parenthesis if position == MacroPosition::Item => {
221+
Some(format!("{macro_name}();"))
222+
}
223+
Delimiter::Bracket if position == MacroPosition::Item => {
224+
Some(format!("{macro_name}[];"))
225+
}
226+
Delimiter::Parenthesis => Some(format!("{macro_name}()")),
227+
Delimiter::Bracket => Some(format!("{macro_name}[]")),
228+
Delimiter::Brace => Some(format!("{macro_name} {{}}")),
229+
_ => unreachable!(),
230230
};
231231
return (rewrite, Some(style));
232232
}

src/patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl Rewrite for Pat {
269269
shape,
270270
),
271271
PatKind::MacCall(ref mac) => {
272-
let (rewrite, _) = rewrite_macro(mac, None, context, shape, MacroPosition::Pat)
272+
let (rewrite, _) = rewrite_macro(mac, None, context, shape, MacroPosition::Pat);
273273
rewrite
274274
}
275275
PatKind::Paren(ref pat) => pat

src/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@ impl Rewrite for ast::Ty {
829829
ast::TyKind::BareFn(ref bare_fn) => rewrite_bare_fn(bare_fn, self.span, context, shape),
830830
ast::TyKind::Never => Some(String::from("!")),
831831
ast::TyKind::MacCall(ref mac) => {
832-
let (rewrite, _) = rewrite_macro(mac, None, context, shape, MacroPosition::Expression);
832+
let (rewrite, _) =
833+
rewrite_macro(mac, None, context, shape, MacroPosition::Expression);
833834
rewrite
834835
}
835836
ast::TyKind::ImplicitSelf => Some(String::from("")),

0 commit comments

Comments
 (0)