diff options
| author | Amos Wenger <amoswenger@gmail.com> | 2022-07-20 15:06:15 +0200 |
|---|---|---|
| committer | Amos Wenger <amoswenger@gmail.com> | 2022-07-20 15:06:15 +0200 |
| commit | 7e285e1ef5f5c14aef4468ebb5d28ca963c52dc1 (patch) | |
| tree | a01ea7517220ab2af572425090e2ca285c9ee4f4 /crates/parser/src | |
| parent | 8318035726c9e2fc2bcb6055855969cb97512b69 (diff) | |
| download | rust-7e285e1ef5f5c14aef4468ebb5d28ca963c52dc1.tar.gz rust-7e285e1ef5f5c14aef4468ebb5d28ca963c52dc1.zip | |
Run cargo fmt
Diffstat (limited to 'crates/parser/src')
| -rw-r--r-- | crates/parser/src/grammar/expressions.rs | 5 | ||||
| -rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 5 | ||||
| -rw-r--r-- | crates/parser/src/grammar/paths.rs | 11 |
3 files changed, 17 insertions, 4 deletions
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 8887f3330bd..e7402104eb8 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -19,7 +19,10 @@ pub(super) fn expr(p: &mut Parser<'_>) -> bool { expr_bp(p, None, r, 1).is_some() } -pub(super) fn expr_stmt(p: &mut Parser<'_>, m: Option<Marker>) -> Option<(CompletedMarker, BlockLike)> { +pub(super) fn expr_stmt( + p: &mut Parser<'_>, + m: Option<Marker>, +) -> Option<(CompletedMarker, BlockLike)> { let r = Restrictions { forbid_structs: false, prefer_stmt: true }; expr_bp(p, m, r, 1) } diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 30aadb1f9d6..99f42a26623 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs @@ -60,7 +60,10 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = const EXPR_RECOVERY_SET: TokenSet = TokenSet::new(&[T![let]]); -pub(super) fn atom_expr(p: &mut Parser<'_>, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { +pub(super) fn atom_expr( + p: &mut Parser<'_>, + r: Restrictions, +) -> Option<(CompletedMarker, BlockLike)> { if let Some(m) = literal(p) { return Some((m, BlockLike::NotBlock)); } diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs index 22c7f003f41..f9efcef92a6 100644 --- a/crates/parser/src/grammar/paths.rs +++ b/crates/parser/src/grammar/paths.rs @@ -27,7 +27,10 @@ pub(super) fn expr_path(p: &mut Parser<'_>) { path(p, Mode::Expr); } -pub(crate) fn type_path_for_qualifier(p: &mut Parser<'_>, qual: CompletedMarker) -> CompletedMarker { +pub(crate) fn type_path_for_qualifier( + p: &mut Parser<'_>, + qual: CompletedMarker, +) -> CompletedMarker { path_for_qualifier(p, Mode::Type, qual) } @@ -45,7 +48,11 @@ fn path(p: &mut Parser<'_>, mode: Mode) { path_for_qualifier(p, mode, qual); } -fn path_for_qualifier(p: &mut Parser<'_>, mode: Mode, mut qual: CompletedMarker) -> CompletedMarker { +fn path_for_qualifier( + p: &mut Parser<'_>, + mode: Mode, + mut qual: CompletedMarker, +) -> CompletedMarker { loop { let use_tree = matches!(p.nth(2), T![*] | T!['{']); if p.at(T![::]) && !use_tree { |
