MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / has_class

Method has_class

css-inline/src/html/attributes.rs:108–124  ·  view source on GitHub ↗
(&self, name: &[u8], case_sensitivity: CaseSensitivity)

Source from the content-addressed store, hash-verified

106
107 #[inline]
108 pub(crate) fn has_class(&self, name: &[u8], case_sensitivity: CaseSensitivity) -> bool {
109 match (&self.cache, case_sensitivity) {
110 (Cache::Single, case_sensitivity) => case_sensitivity.eq(self.value.as_bytes(), name),
111 (Cache::Bloom(bloom_filter), CaseSensitivity::CaseSensitive) => {
112 if bloom_filter.might_have_class(name) {
113 self.has_class_impl(name, case_sensitivity)
114 } else {
115 // Class is not in the Bloom filter, hence this `class` value does not
116 // contain the given class
117 false
118 }
119 }
120 (Cache::Bloom(_), CaseSensitivity::AsciiCaseInsensitive) => {
121 self.has_class_impl(name, case_sensitivity)
122 }
123 }
124 }
125}
126
127#[inline]

Callers

nothing calls this directly

Calls 4

eqMethod · 0.80
as_bytesMethod · 0.80
might_have_classMethod · 0.80
has_class_implMethod · 0.80

Tested by

no test coverage detected