Remix.run Logo
mjr00 2 hours ago

This is Rust we're talking about. It doesn't even need to work; as long as it compiles, it's correct.

speedgoose 2 hours ago | parent | next [-]

    use std::fs::File;
    use std::io::prelude::*;
    
    fn main() -> std::io::Result<()> {
        let mut file = File::create("content.txt")?;
        file.write_all(b"3!")?;
        Ok(())
    }
rakel_rakel 2 hours ago | parent [-]

; cat content.txt 3!;

dataflow 2 hours ago | parent | prev [-]

> This is Rust we're talking about. It doesn't even need to work; as long as it compiles, it's correct.

No, it doesn't even need to compile. The mere fact that it's in Rust means it's correct.