Skip to content

Appendix B: Minor inconsistency in table of operators #3189

@ijc8

Description

@ijc8
  • I have checked the latest main branch to see if this has already been fixed
  • I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/appendix-02-operators.html#operators

Description of the problem:
There is a slight inconsistency in Table B-1, which lists Rust's operators with short examples for context. In this table, var is used as a stand-in for the LHS of assignment operators (as in var += expr). However, it's also used in the example for != (var != expr). This does not match the other non-assigning operators (== has the example expr == expr) and could give the mistaken impression that != is an assignment operator.

Suggested fix:
Change the example for != from var != expr to expr != expr, which will make it consistent with the rest of the table and avoid giving the impression that != assigns to the LHS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions