We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05a652c commit 3cfa159Copy full SHA for 3cfa159
string-interner/src/lib.rs
@@ -8,6 +8,16 @@ use std::sync::Mutex;
8
/// Global interner
9
pub static INTERNER: SyncLazy<Mutex<StringInterner>> = SyncLazy::new(|| Mutex::new(StringInterner::new()));
10
11
+#[inline]
12
+pub fn get_symbol(value: String) -> Symbol {
13
+ INTERNER.lock().unwrap().get_symbol(value)
14
+}
15
+
16
17
+pub fn get_value(s: Symbol) -> Option<String> {
18
+ INTERNER.lock().unwrap().get_value(s)
19
20
21
pub struct StringInterner {
22
symbol_map: HashMap<String, usize>,
23
symbols: Vec<String>,
0 commit comments