You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of version 1.34.0, one can also omit the fn main(), but you will have to disambiguate the error type:
/// ```/// use std::io;/// let mut input = String::new();/// io::stdin().read_line(&mut input)?;/// # Ok::<(), io::Error>(())/// ```
The C-QUESTION-MARK example should adopt this new syntax, since this syntactic sugar encourages doc authors to adopt the ? syntax without a lot of ugly boilerplate.
The text was updated successfully, but these errors were encountered:
SOF3
changed the title
C-QUESTION-MARK: Use shorthand main error type syntax
C-QUESTION-MARK: Use simpler main error type syntax
Aug 12, 2019
According to the rustdoc book:
The C-QUESTION-MARK example should adopt this new syntax, since this syntactic sugar encourages doc authors to adopt the
?
syntax without a lot of ugly boilerplate.The text was updated successfully, but these errors were encountered: