Best way to write a file from a Vec<u8>

The question is simple, even the title gives it all away. But simply what is the best, and by best I mean fastest or best for games, way to write to a file from a Vec<u8>.

std::fs::write can take a filename and a Vec<u8>. For example:

fn main() {
    let data = vec![0u8; 100];
    std::fs::write("foo.bin", data).unwrap();
}
4 Likes

Wow nice

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.