From a5839662f448602d6aa2d724432844fc2d08947e Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 5 Nov 2019 01:16:06 +0800 Subject: Change to add 1 if non zero shift --- crates/ra_mbe/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_mbe/src') 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 { // 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 }) } -- cgit v1.2.3