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

Method str_slice

crates/css_lexer/src/cursor.rs:65–73  ·  view source on GitHub ↗
(&self, str: &'a str)

Source from the content-addressed store, hash-verified

63
64 #[inline(always)]
65 pub fn str_slice<'a>(&self, str: &'a str) -> &'a str {
66 debug_assert!(
67 str.len() >= (self.end_offset().0 as usize),
68 "attempted to index out of bounds ({} < {})",
69 str.len(),
70 self.end_offset().0
71 );
72 &str[(self.offset().0 as usize)..(self.end_offset().0 as usize)]
73 }
74
75 pub fn with_quotes(&self, quote_style: QuoteStyle) -> Self {
76 if *self == quote_style || *self != Kind::String {

Callers 15

highlight_lineMethod · 0.80
to_source_cursorMethod · 0.80
convert_tokenFunction · 0.80
tokenizes_block_commentFunction · 0.80
tokenizes_basic_selectorFunction · 0.80
tokenizes_basic_css_fileFunction · 0.80
tokenizes_escaped_urlFunction · 0.80
tokenizes_wtfFunction · 0.80

Calls 2

end_offsetMethod · 0.80
offsetMethod · 0.45