limbo_sqlite3_parser/parser/ast/
name_traits.rs1use std::str::{self};
15
16use super::functions::eq_ignore_case_and_quote;
17use super::types::Name;
18use super::types_10::QuotedIterator;
19
20impl std::hash::Hash for Name {
22 fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
23 self.as_bytes()
24 .for_each(|b| hasher.write_u8(b.to_ascii_lowercase()));
25 }
26}
27impl PartialEq for Name {
29 fn eq(&self, other: &Self) -> bool {
30 eq_ignore_case_and_quote(self.as_bytes(), other.as_bytes())
31 }
32}
33impl PartialEq<str> for Name {
35 fn eq(&self, other: &str) -> bool {
36 eq_ignore_case_and_quote(self.as_bytes(), QuotedIterator(other.bytes(), 0u8))
37 }
38}
39impl PartialEq<&str> for Name {
41 fn eq(&self, other: &&str) -> bool {
42 eq_ignore_case_and_quote(self.as_bytes(), QuotedIterator(other.bytes(), 0u8))
43 }
44}