Skip to content

? operator should be in the first, not last, sub-section of 18.4. Result #1836

@svetli97

Description

@svetli97

Since the ? operator is in the last sub-section of 18.4. Result, all the other sub-sections and the main section are filled with code of the type:

let number = match number_str.parse::<i32>() {
    Ok(number)  => number,
    Err(e) => return Err(e),
};

This is really confusing. Especially for someone who is reading the sections in order because in 18.3. Option & unwrap, the ? operator is in the first sub-section. You are telling the reader what the good way of doing something is but then giving him 4 sections of code written in what you just described as the worse way of doing it...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions