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

Method str_to_bits

crates/css_lexer/src/atom_set.rs:181–183  ·  view source on GitHub ↗
(&self, keyword: &str)

Source from the content-addressed store, hash-verified

179/// Blanket implementation so any AtomSet can be used as a DynAtomSet
180impl<T: AtomSet + Clone + 'static> DynAtomSet for T {
181 fn str_to_bits(&self, keyword: &str) -> u32 {
182 T::from_str(keyword).as_bits()
183 }
184
185 fn bits_to_str(&self, bits: u32) -> &'static str {
186 T::from_bits(bits).to_str()

Callers 3

consume_numeric_tokenMethod · 0.45
equals_atomMethod · 0.45

Calls 1

as_bitsMethod · 0.80

Tested by

no test coverage detected