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

Method to_atom

crates/csskit_transform/src/transformer.rs:89–99  ·  view source on GitHub ↗
(&self, c: Cursor)

Source from the content-addressed store, hash-verified

87 }
88
89 pub fn to_atom<A: AtomSet + PartialEq>(&self, c: Cursor) -> A {
90 let bits = c.atom_bits();
91 if bits == 0 {
92 if c != KindSet::ATOM_LIKE {
93 return A::from_bits(0);
94 }
95 let source_cursor = self.to_source_cursor(c);
96 return A::from_str(&source_cursor.parse(self.bump));
97 }
98 A::from_bits(bits)
99 }
100
101 pub fn overlays(&self) -> std::cell::Ref<'_, CursorOverlaySet<'a>> {
102 self.overlays.borrow()

Callers

nothing calls this directly

Calls 3

atom_bitsMethod · 0.45
to_source_cursorMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected