impl PartialEq<str> and PartialEq<&str> for Atom

This commit is contained in:
Bennet Bleßmann
2024-08-03 22:41:02 +02:00
parent 880e22d164
commit 17a816eff4

View File

@@ -56,6 +56,18 @@ impl indexmap::Equivalent<Atom> for str {
}
}
impl PartialEq<str> for Atom {
fn eq(&self, other: &str) -> bool {
self.as_str().deref() == other
}
}
impl PartialEq<&str> for Atom {
fn eq(&self, &other: &&str) -> bool {
self.as_str().deref() == other
}
}
const ATOM_TABLE_INIT_SIZE: usize = 1 << 16;
const ATOM_TABLE_ALIGN: usize = 8;