What's the de-facto way of reading and writing files in Rust 1.x?
@lebyy▲ 0 net votes
Problem: With Rust being comparatively new, I've seen far too many ways of reading and writing files. Many are extremely messy snippets someone came up with for their blog, and 99% of the examples I've found (even on Stack Overflow) are from unstable builds that no… Fix (from the top answer): None of the functions I show here panic on their own, but I am using expect because I don't know what kind of error handling will fit best into your application. Go read The Rust Programming Language 's chapter on error handling to understand how to appropriately handle failure in your own program. Rust 1.26 and…