MCPcopy Create free account
hub / github.com/SharpCoder/teensycore / clear

Method clear

src/system/str.rs:152–169  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

150 }
151
152 pub fn clear(&mut self) {
153 // Iterate through each block and reset "used".
154 let mut ptr = self.head;
155 loop {
156 if ptr.is_none() {
157 break;
158 }
159
160 let node = ptr.unwrap();
161 unsafe {
162 (*node).used = 0;
163 ptr = (*node).next;
164 }
165 }
166
167 self.index = 0;
168 self.tail = self.head;
169 }
170
171 /// Returns a new Str containing the characters
172 /// between the indexes.

Callers 6

resetMethod · 0.45
usb_serial_configureFunction · 0.45
usb_serial_flushFunction · 0.45
test_atoiFunction · 0.45
splitMethod · 0.45
test_clearFunction · 0.45

Calls

no outgoing calls

Tested by 2

test_atoiFunction · 0.36
test_clearFunction · 0.36