summary refs log tree commit diff stats
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs
index eb378ad..744ab0f 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -354,7 +354,7 @@ where
             let self_ = &mut *self;
             let id = id.unwrap_or_else(move || {
                 string.shrink_to_fit();
-                self_.consts.strings.push(string);
+                self_.consts.strings.insert(string);
                 self_.consts.strings.len() - 1
             });
             self.tokens.push(PatternToken::String(id, skippable));
@@ -499,7 +499,7 @@ where
             // no processing of `name` is required for this.
             let id = self.consts.strings.iter().position(|c| c == name);
             let id = id.unwrap_or_else(|| {
-                self.consts.strings.push(name.into());
+                self.consts.strings.insert(name.into());
                 self.consts.strings.len() - 1
             });
             self.tokens.push(PatternToken::Identifier(id));