MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / next

Method next

euralios_std/src/env.rs:27–43  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

25 type Item = (String, String);
26
27 fn next(&mut self) -> Option<(String, String)> {
28 if self.pos >= self.envs.len() {
29 return None;
30 }
31 let remaining = &self.envs[self.pos..];
32
33 // Records split using 0x03 bytes
34 if let Some(pair) = remaining.split('\u{03}').next() {
35 self.pos += pair.len() + 1;
36 // Split pair by '='
37 let mut key_value = pair.split('=');
38 Some((String::from(key_value.next()?),
39 String::from(key_value.next()?)))
40 } else {
41 None
42 }
43 }
44}
45
46/// Returns an iterator over the (key, value) pairs

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected