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

Method write_str

crates/css_lexer/src/small_str_buf.rs:38–47  ·  view source on GitHub ↗
(&mut self, s: &str)

Source from the content-addressed store, hash-verified

36
37impl<const N: usize> Write for SmallStrBuf<N> {
38 fn write_str(&mut self, s: &str) -> Result {
39 let b = s.as_bytes();
40 let n = b.len() as u8;
41 if (self.0 + n) as usize > N {
42 return Err(Error);
43 }
44 self.1[self.0 as usize..(self.0 + n) as usize].copy_from_slice(b);
45 self.0 += n;
46 Ok(())
47 }
48}

Callers 15

finishMethod · 0.80
appendMethod · 0.80
fmtMethod · 0.80
fmt_compactedMethod · 0.80
fmt_compacted_numberMethod · 0.80
fmt_compacted_identMethod · 0.80
fmt_compacted_urlMethod · 0.80
fmt_expandedMethod · 0.80
fmt_expanded_numberMethod · 0.80
fmt_expanded_identMethod · 0.80
fmt_expanded_urlMethod · 0.80
fmtMethod · 0.80

Calls 2

ErrClass · 0.85
lenMethod · 0.45

Tested by 2

finishMethod · 0.64
appendMethod · 0.64