-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Labels
acceptedAn amendment that's been accepted and can be appliedAn amendment that's been accepted and can be appliedpresentation
Description
According to the rustdoc book:
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.
newAM
Metadata
Metadata
Assignees
Labels
acceptedAn amendment that's been accepted and can be appliedAn amendment that's been accepted and can be appliedpresentation
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]C-QUESTION-MARK: Use shorthand main error type syntax[/-][+]C-QUESTION-MARK: Use simpler main error type syntax[/+]KodrAus commentedon Dec 21, 2020
This would be a nice bit of gardening if anybody would like to tidy up the example blocks!
tshepang commentedon Dec 22, 2020
I could not find other example blocks where this change would be applicable @KodrAus