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

Method compact

crates/css_lexer/src/source_cursor.rs:140–148  ·  view source on GitHub ↗

Returns a new `SourceCursor` with the `should_compact` flag set. With the `should_compact` flag set, the cursor will format with optimised displays of: - Numbers: Remove leading zeros (`0.8` -> `.8`), trailing zeros (`1.0` -> `1`), redundant `+` sign - Idents/Functions/AtKeywords: Write UTF-8 instead of escape codes - Dimensions: Same as numbers for the number part, and same as Idents for the uni

(&self)

Source from the content-addressed store, hash-verified

138 /// - Whitespace: Normalize to a single space
139 ///
140 pub fn compact(&self) -> SourceCursor<'a> {
141 Self {
142 cursor: self.cursor,
143 source: self.source,
144 should_compact: true,
145 #[cfg(feature = "egg")]
146 should_expand: false,
147 }
148 }
149
150 /// Returns a new `SourceCursor` with the `should_expand` flag set.
151 ///

Callers 1

writeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected