Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's an example of using stdout.write at the top of this page: 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(())
    }


I should improve this example, in its current form you could drop the ? and the Ok stuff...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: