diff options
author | Edwin Cheng <[email protected]> | 2019-11-04 17:16:06 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-04 17:16:06 +0000 |
commit | a5839662f448602d6aa2d724432844fc2d08947e (patch) | |
tree | 1453254be75301226f9b911043f72802257dcc61 | |
parent | 188a1412b9d21ead5d823ce3ca00d3b4f823221b (diff) |
Change to add 1 if non zero shift
-rw-r--r-- | crates/ra_mbe/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs index b92312d52..15f000175 100644 --- a/crates/ra_mbe/src/lib.rs +++ b/crates/ra_mbe/src/lib.rs | |||
@@ -108,7 +108,7 @@ impl MacroRules { | |||
108 | 108 | ||
109 | // Note that TokenId is started from zero, | 109 | // Note that TokenId is started from zero, |
110 | // We have to add 1 to prevent duplication. | 110 | // We have to add 1 to prevent duplication. |
111 | let shift = max_id(tt).unwrap_or(0) + 1; | 111 | let shift = max_id(tt).map_or(0, |it| it + 1); |
112 | Ok(MacroRules { rules, shift }) | 112 | Ok(MacroRules { rules, shift }) |
113 | } | 113 | } |
114 | 114 | ||