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

Method write_str

edit/src/main.rs:192–201  ·  view source on GitHub ↗
(&mut self, s: &str)

Source from the content-addressed store, hash-verified

190
191impl Write for Buffer<'_> {
192 fn write_str(&mut self, s: &str) -> fmt::Result {
193 let space_left = self.0.len() - self.1;
194 if space_left > s.len() {
195 self.0[self.1..][..s.len()].copy_from_slice(s.as_bytes());
196 self.1 += s.len();
197 Ok(())
198 } else {
199 Err(fmt::Error)
200 }
201 }
202}
203
204fn display(file: &File) {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected