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

Method fill_buffer

crates/css_parse/src/parser.rs:95–104  ·  view source on GitHub ↗
(&mut self, from: usize)

Source from the content-addressed store, hash-verified

93 }
94
95 fn fill_buffer(&mut self, from: usize) {
96 // Shift remaining buffer cursors left to the start of the slice.
97 self.buffer.copy_within(from..BUFFER_LEN, 0);
98 // Re-fill the buffer with new cursors.
99 let eof = eof_cursor(self.source_text.len());
100 for i in BUFFER_LEN - from..BUFFER_LEN {
101 self.buffer[i] = self.cursor_iter.next().unwrap_or(eof);
102 }
103 self.buffer_index = 0;
104 }
105
106 #[inline]
107 pub fn bump(&self) -> &'a Bump {

Callers 2

consume_triviaMethod · 0.80
nextMethod · 0.80

Calls 3

eof_cursorFunction · 0.85
lenMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected