Re:Getting started with Rust by building a tiny Markdown com...
by JoshTriplett on Saturday May 16, 2020 @08:10PM
(#23208274)
> Rustian (Rustic? Rust-guy?);
"Rustacean", pronounced like "crustacean" without the initial 'c'; remember that Rust's logo is a crab (named Ferris).
Also, regarding ".except": like ".unwrap", you almost never want to use it, because it panics on failure. Instead, you can write:
let file = File::open(&input_filename)?;
That will propagate the error upwards; if you propagate an error out of main, Rust will print an error message and exit with exit code 1, which is often what you want. Some error handling libraries also let you add context to the error before propagating it.
"Rustacean", pronounced like "crustacean" without the initial 'c'; remember that Rust's logo is a crab (named Ferris).
Also, regarding ".except": like ".unwrap", you almost never want to use it, because it panics on failure. Instead, you can write:
That will propagate the error upwards; if you propagate an error out of main, Rust will print an error message and exit with exit code 1, which is often what you want. Some error handling libraries also let you add context to the error before propagating it.