MCPcopy Index your code
hub / github.com/endbasic/endbasic / split_off

Method split_off

std/src/console/linebuffer.rs:130–134  ·  view source on GitHub ↗

Splits the buffer in two parts at the position `at`. Returns the remaining part of the buffer (same behavior as `String::split_off`).

(&mut self, at: usize)

Source from the content-addressed store, hash-verified

128 ///
129 /// Returns the remaining part of the buffer (same behavior as `String::split_off`).
130 pub fn split_off(&mut self, at: usize) -> LineBuffer {
131 let ret = LineBuffer::from(self.line.chars().skip(at).collect::<String>());
132 self.line = self.line.chars().take(at).collect();
133 ret
134 }
135}
136
137impl From<&str> for LineBuffer {

Callers 4

parse_aclMethod · 0.80
test_split_offFunction · 0.80
raw_write_wrappedMethod · 0.80
edit_interactivelyMethod · 0.80

Calls 1

charsMethod · 0.80

Tested by 1

test_split_offFunction · 0.64