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

Method append

crates/css_parse/src/cursor_overlay_sink.rs:152–165  ·  view source on GitHub ↗
(&mut self, c: SourceCursor<'a>)

Source from the content-addressed store, hash-verified

150
151impl<'a, 'o, T: SourceCursorSink<'a>> SourceCursorSink<'a> for CursorOverlaySink<'a, 'o, T> {
152 fn append(&mut self, c: SourceCursor<'a>) {
153 let cursor_start = c.to_span().start();
154 let cursor_end = c.to_span().end();
155
156 self.flush_segments_up_to(cursor_start, false);
157
158 if self.cursor_is_consumed(cursor_start, cursor_end) {
159 return;
160 }
161
162 self.sink.append(c);
163
164 self.flush_segments_up_to(cursor_end, true);
165 }
166}
167
168impl<'a, 'o, T: SourceCursorSink<'a>> CursorSink for CursorOverlaySink<'a, 'o, T> {

Callers 1

flush_segments_up_toMethod · 0.45

Calls 6

flush_segments_up_toMethod · 0.80
cursor_is_consumedMethod · 0.80
str_sliceMethod · 0.80
startMethod · 0.45
to_spanMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected