MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / read_to_str

Method read_to_str

src/fs/file.rs:108–117  ·  view source on GitHub ↗

Read to string

(&mut self)

Source from the content-addressed store, hash-verified

106
107 // Read to string
108 pub fn read_to_str(&mut self) -> String
109 {
110 let mut buffer = vec![0; self.size()];
111 if let Ok(bytes) = self.read(&mut buffer)
112 {
113 buffer.resize(bytes, 0);
114 }
115
116 String::from_utf8_lossy(&buffer).to_string()
117 }
118
119
120 // Seek

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected