mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
fix: add parenthesis for or-pattern
This commit is contained in:
parent
5caa56e18a
commit
5c97361622
2 changed files with 18 additions and 1 deletions
|
@ -599,12 +599,14 @@ impl Printer<'_> {
|
|||
w!(self, ")");
|
||||
}
|
||||
Pat::Or(pats) => {
|
||||
w!(self, "(");
|
||||
for (i, pat) in pats.iter().enumerate() {
|
||||
if i != 0 {
|
||||
w!(self, " | ");
|
||||
}
|
||||
self.print_pat(*pat);
|
||||
}
|
||||
w!(self, ")");
|
||||
}
|
||||
Pat::Record { path, args, ellipsis } => {
|
||||
match path {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue