Skip to content

Commit 9117148

Browse files
committed
Add bindings builder for speed up matching
1 parent f1350dd commit 9117148

File tree

3 files changed

+221
-67
lines changed

3 files changed

+221
-67
lines changed

crates/mbe/src/expander.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
mod matcher;
66
mod transcriber;
77

8-
use smallvec::SmallVec;
8+
use rustc_hash::FxHashMap;
99
use syntax::SmolStr;
1010

1111
use crate::{ExpandError, ExpandResult};
@@ -96,7 +96,7 @@ pub(crate) fn expand_rules(
9696
/// many is not a plain `usize`, but an `&[usize]`.
9797
#[derive(Debug, Default, Clone, PartialEq, Eq)]
9898
struct Bindings {
99-
inner: SmallVec<[(SmolStr, Binding); 4]>,
99+
inner: FxHashMap<SmolStr, Binding>,
100100
}
101101

102102
#[derive(Debug, Clone, PartialEq, Eq)]

0 commit comments

Comments
 (0)