Skip to content

Consider normalising match reference style #929

Closed
@chris-morgan

Description

@chris-morgan

Consider these two examples:

match x {
    &A => ...,
    ...
}
match *x {
    A => ...,
    ...
}

The two are not precisely equivalent, because the first only works if x is an immutable reference while the second dereferences and is thus more general. But any instance of the former can be converted to the latter form with no change in functionality.

I personally would like to see rustfmt normalising the former to the latter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions