Hacker News new | ask | show | jobs
by mjr00 43 days ago
This is Rust we're talking about. It doesn't even need to work; as long as it compiles, it's correct.
2 comments

    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(())
    }
; cat content.txt 3!;
> 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.