Skip to content

Commit fd9e7d3

Browse files
chore: run rustfmt against source
1 parent e2e7fac commit fd9e7d3

File tree

2 files changed

+38
-26
lines changed

2 files changed

+38
-26
lines changed

src/formatting/comment.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ fn custom_opener(s: &str) -> &str {
4949
impl<'a> CommentStyle<'a> {
5050
/// Returns `true` if the commenting style covers a line only.
5151
pub(crate) fn is_line_comment(&self) -> bool {
52-
matches!(*self, CommentStyle::DoubleSlash
53-
| CommentStyle::TripleSlash
54-
| CommentStyle::Doc
55-
| CommentStyle::Custom(_))
52+
matches!(
53+
*self,
54+
CommentStyle::DoubleSlash
55+
| CommentStyle::TripleSlash
56+
| CommentStyle::Doc
57+
| CommentStyle::Custom(_)
58+
)
5659
}
5760

5861
/// Returns `true` if the commenting style can span over multiple lines.

src/formatting/macros.rs

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,11 @@ fn delim_token_to_str(
705705

706706
impl MacroArgKind {
707707
fn starts_with_brace(&self) -> bool {
708-
matches!(*self, MacroArgKind::Repeat(DelimToken::Brace, _, _, _)
709-
| MacroArgKind::Delimited(DelimToken::Brace, _))
708+
matches!(
709+
*self,
710+
MacroArgKind::Repeat(DelimToken::Brace, _, _, _)
711+
| MacroArgKind::Delimited(DelimToken::Brace, _)
712+
)
710713
}
711714

712715
fn starts_with_dollar(&self) -> bool {
@@ -1146,29 +1149,35 @@ enum SpaceState {
11461149
fn force_space_before(tok: &TokenKind) -> bool {
11471150
debug!("tok: force_space_before {:?}", tok);
11481151

1149-
matches!(tok, TokenKind::Eq
1150-
| TokenKind::Lt
1151-
| TokenKind::Le
1152-
| TokenKind::EqEq
1153-
| TokenKind::Ne
1154-
| TokenKind::Ge
1155-
| TokenKind::Gt
1156-
| TokenKind::AndAnd
1157-
| TokenKind::OrOr
1158-
| TokenKind::Not
1159-
| TokenKind::Tilde
1160-
| TokenKind::BinOpEq(_)
1161-
| TokenKind::At
1162-
| TokenKind::RArrow
1163-
| TokenKind::LArrow
1164-
| TokenKind::FatArrow
1165-
| TokenKind::BinOp(_)
1166-
| TokenKind::Pound
1167-
| TokenKind::Dollar)
1152+
matches!(
1153+
tok,
1154+
TokenKind::Eq
1155+
| TokenKind::Lt
1156+
| TokenKind::Le
1157+
| TokenKind::EqEq
1158+
| TokenKind::Ne
1159+
| TokenKind::Ge
1160+
| TokenKind::Gt
1161+
| TokenKind::AndAnd
1162+
| TokenKind::OrOr
1163+
| TokenKind::Not
1164+
| TokenKind::Tilde
1165+
| TokenKind::BinOpEq(_)
1166+
| TokenKind::At
1167+
| TokenKind::RArrow
1168+
| TokenKind::LArrow
1169+
| TokenKind::FatArrow
1170+
| TokenKind::BinOp(_)
1171+
| TokenKind::Pound
1172+
| TokenKind::Dollar
1173+
)
11681174
}
11691175

11701176
fn ident_like(tok: &Token) -> bool {
1171-
matches!(tok.kind, TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(_))
1177+
matches!(
1178+
tok.kind,
1179+
TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(_)
1180+
)
11721181
}
11731182

11741183
fn next_space(tok: &TokenKind) -> SpaceState {

0 commit comments

Comments
 (0)