This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::borrow::Borrow;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::ops::Deref;
|
||||
@@ -5,7 +6,6 @@ use std::sync::{Arc, Mutex, Weak};
|
||||
|
||||
use conquer_once::OnceCell;
|
||||
use hashbrown::HashMap;
|
||||
use indexmap::Equivalent;
|
||||
|
||||
/// StringKey is an immutable string that is used for indexing of hashmaps or equality a lot.
|
||||
/// By reference counting the string instead of copying, and caching the hash, we can get some
|
||||
@@ -103,9 +103,9 @@ impl From<&str> for StringKey {
|
||||
}
|
||||
}
|
||||
|
||||
impl Equivalent<StringKey> for u32 {
|
||||
fn equivalent(&self, key: &StringKey) -> bool {
|
||||
*self == key.hash
|
||||
impl Borrow<u32> for StringKey {
|
||||
fn borrow(&self) -> &u32 {
|
||||
&self.hash
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user