4 ms·
There'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.htm
by Tobu 8y ago
There'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...