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

Method insert

crates/css_parse/src/cursor_overlay_sink.rs:55–62  ·  view source on GitHub ↗
(&mut self, span: Span, cursors: Vec<'a, SourceCursor<'a>>)

Source from the content-addressed store, hash-verified

53 }
54
55 pub fn insert(&mut self, span: Span, cursors: Vec<'a, SourceCursor<'a>>) {
56 #[cfg(debug_assertions)]
57 {
58 let has_non_eof = cursors.iter().any(|cursor| cursor.token() != Kind::Eof);
59 debug_assert!(has_non_eof || cursors.is_empty(), "Overlay for span {:?} produced no output", span);
60 }
61 self.push_segment(OverlaySegment::new(span, cursors, OverlayKind::Replace));
62 }
63
64 pub fn clear(&mut self) {
65 self.segments.clear();

Callers 8

to_chromashiftMethod · 0.45
atomizeMethod · 0.45
parseMethod · 0.45
appendMethod · 0.45
push_segmentMethod · 0.45
flush_segments_up_toMethod · 0.45
test_basicFunction · 0.45
test_with_pretty_writerFunction · 0.45

Calls 3

iterMethod · 0.80
push_segmentMethod · 0.80
tokenMethod · 0.45

Tested by 2

test_basicFunction · 0.36
test_with_pretty_writerFunction · 0.36