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

Method has_class_impl

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

Source from the content-addressed store, hash-verified

96 /// Manually check whether the class attribute value contains the given class.
97 #[inline]
98 fn has_class_impl(&self, name: &[u8], case_sensitivity: CaseSensitivity) -> bool {
99 for class in self.value.as_bytes().split(|&b| is_selector_whitespace(b)) {
100 if case_sensitivity.eq(class, name) {
101 return true;
102 }
103 }
104 false
105 }
106
107 #[inline]
108 pub(crate) fn has_class(&self, name: &[u8], case_sensitivity: CaseSensitivity) -> bool {

Callers 1

has_classMethod · 0.80

Calls 3

is_selector_whitespaceFunction · 0.85
as_bytesMethod · 0.80
eqMethod · 0.80

Tested by

no test coverage detected