3 ms·
How would you write it, out of curiosity?
by yawaramin 8y ago
How would you write it, out of curiosity?
- agumonkey 8y agono idea, but puts is memcopy right ? println! / printf involve megatons of steps
- Tobu 8y agoThere's an example of using stdout.write at the top of this page: https://doc.rust-lang.org/std/io/fn.stdout.html https://doc.rust-lang.org/std/io/fn.stdout.html use std::io::{self, Write}; fn main() -> io::Result<()> { io::stdout().write(b"hello world")?; Ok(()) }
- steveklabnik 8y agoI should improve this example, in its current form you could drop the ? and the Ok stuff...