Skip to content

Code example in the Guide could be improved #15452

Closed
@aochagavia

Description

@aochagavia

There is a code example in section 0.7.1 of the Guide (http://static.rust-lang.org/doc/master/guide.html#expressions-vs.-statements), which could be improved.

We use this:

let mut x = 0i;
let y = x = 5i;

But, in my opinion, it would be better to use this (avoids making x mutable):

let x;
let y = x = 5i;

Is there a reason why we prefer the first code snippet instead of the second? I could submit a PR to fix it.

cc @steveklabnik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions