Skip to content

C-QUESTION-MARK: Use simpler main error type syntax #201

Open
@SOF3

Description

@SOF3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedAn amendment that's been accepted and can be appliedpresentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions