mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Change to add 1 if non zero shift
This commit is contained in:
parent
188a1412b9
commit
a5839662f4
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ impl MacroRules {
|
|||
|
||||
// Note that TokenId is started from zero,
|
||||
// We have to add 1 to prevent duplication.
|
||||
let shift = max_id(tt).unwrap_or(0) + 1;
|
||||
let shift = max_id(tt).map_or(0, |it| it + 1);
|
||||
Ok(MacroRules { rules, shift })
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue