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

Method fmt_expanded_url

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

Source from the content-addressed store, hash-verified

452
453 #[cfg(feature = "egg")]
454 fn fmt_expanded_url(&self, f: &mut Formatter<'_>) -> Result {
455 let token = self.token();
456 let leading_len = token.leading_len() as usize;
457 let trailing_len = token.trailing_len() as usize;
458 let url_prefix = &self.source[..leading_len];
459 let url_content = &self.source[leading_len..(self.source.len() - trailing_len)];
460 f.write_str(url_prefix)?;
461 f.write_str(" ")?;
462 f.write_str(url_content.trim())?;
463 f.write_str(" ")?;
464 if token.url_has_closing_paren() {
465 f.write_str(")")?;
466 }
467 Ok(())
468 }
469
470 #[cfg(feature = "egg")]
471 fn fmt_expanded_string(&self, f: &mut Formatter<'_>) -> Result {

Callers 1

fmt_expandedMethod · 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