mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add bindings builder for speed up matching
This commit is contained in:
parent
f1350dd93c
commit
9117148f42
3 changed files with 221 additions and 67 deletions
|
@ -5,7 +5,7 @@
|
|||
mod matcher;
|
||||
mod transcriber;
|
||||
|
||||
use smallvec::SmallVec;
|
||||
use rustc_hash::FxHashMap;
|
||||
use syntax::SmolStr;
|
||||
|
||||
use crate::{ExpandError, ExpandResult};
|
||||
|
@ -96,7 +96,7 @@ pub(crate) fn expand_rules(
|
|||
/// many is not a plain `usize`, but an `&[usize]`.
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||
struct Bindings {
|
||||
inner: SmallVec<[(SmolStr, Binding); 4]>,
|
||||
inner: FxHashMap<SmolStr, Binding>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue