E0113
Variant name not capitalized
ErrorUnsafe fixA variant name starts with an upper-case letter: North, not north. The unsafe fix capitalizes it. A name that does not start with a lower-case letter, such as _north, gets no fix: capitalizing _north would change nothing.
Why
A pattern tells a variant from a new binding by its first letter: North => ... tests for the variant, and north => ... binds whatever value is there. The fix is unsafe because the capitalized name may already be taken.
Broken
enum Direction {
north
South
}
fn main() {
print(1)
}
What sisu says
error[E0113]: a variant name starts with an upper-case letter: `North` --> E0113.sisu:2:5 | 2 | north | ^^^^^ | help: capitalize it | 2 - north 2 + North | sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0113
Fixed
enum Direction {
North
South
}
fn main() {
let d = Direction.North
print(d == Direction.South)
}
Sisu