Change to add 1 if non zero shift
This commit is contained in:
parent
188a1412b9
commit
a5839662f4
@ -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…
x
Reference in New Issue
Block a user