MCPcopy Create free account
hub / github.com/csskit/csskit / semantic_eq

Method semantic_eq

crates/css_parse/src/traits/semantic_eq.rs:16–26  ·  view source on GitHub ↗
(&self, other: &Self)

Source from the content-addressed store, hash-verified

14// Implement for Cursor - compare tokens without considering source offset
15impl SemanticEq for Cursor {
16 fn semantic_eq(&self, other: &Self) -> bool {
17 // For Delims, we ignore associated whitespace rules since
18 // those are formatting hints, not semantic content
19 match self.token().kind() {
20 Kind::Delim => {
21 self.token().with_associated_whitespace(css_lexer::AssociatedWhitespaceRules::none())
22 == other.token().with_associated_whitespace(css_lexer::AssociatedWhitespaceRules::none())
23 }
24 _ => self.token() == other.token(),
25 }
26 }
27}
28
29impl<T> SemanticEq for Option<T>

Callers

nothing calls this directly

Calls 4

kindMethod · 0.45
tokenMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected