most languages don't just ignore nonzero syscall return codes by default, they turn them into exceptions or panics or something like that
It checks errors and panics. This was a design decision to minimize the amount of noise for common cases. println! is a convenience macro. println!(“foo”) is shorthand for: writeln!(std::io::stdout(), “foo”).unwrap()
-
-
It was *always* intended that print/println is a convenience macro, and write/writeln is the one you use for proper error handling. Maybe that was not made clear enough, but that was the design.
-
In that case the tutorials/hello worlds should be teaching write/writeln and pretending println doesn't exist...
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.