MCPcopy Create free account
hub / github.com/LaihoE/Python-demoparser / read_string

Method read_string

src/parsing/read_bytes.rs:31–43  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

29 }
30 #[inline]
31 pub fn read_string(&mut self) -> String {
32 let mut v = vec![];
33 loop {
34 let c = self.read_byte();
35 if c != 0 {
36 v.push(c)
37 } else {
38 break;
39 }
40 }
41 let s = String::from_utf8_lossy(&v);
42 s.to_string()
43 }
44 #[inline]
45 pub fn read_i32(&mut self) -> i32 {
46 let i = i32::from_le_bytes(self.bytes[self.fp..self.fp + 4].try_into().unwrap());

Callers

nothing calls this directly

Calls 1

read_byteMethod · 0.80

Tested by

no test coverage detected