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

Method fmt_compacted_url

crates/css_lexer/src/source_cursor.rs:323–334  ·  view source on GitHub ↗
(&self, f: &mut Formatter<'_>)

Source from the content-addressed store, hash-verified

321 }
322
323 fn fmt_compacted_url(&self, f: &mut Formatter<'_>) -> Result {
324 let token = self.token();
325 let leading_len = token.leading_len() as usize;
326 let trailing_len = token.trailing_len() as usize;
327 f.write_str("url(")?;
328 let url_content = &self.source[leading_len..(self.source.len() - trailing_len)];
329 f.write_str(url_content.trim())?;
330 if token.url_has_closing_paren() {
331 f.write_str(")")?;
332 }
333 Ok(())
334 }
335
336 fn fmt_compacted_string(&self, f: &mut Formatter<'_>) -> Result {
337 let token = self.token();

Callers 1

fmt_compactedMethod · 0.80

Calls 6

leading_lenMethod · 0.80
trailing_lenMethod · 0.80
write_strMethod · 0.80
url_has_closing_parenMethod · 0.80
tokenMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected