Skip to content

Commit f90d40e

Browse files
author
Matthew Healy
committed
Tighten grammar in section
1 parent 7f7510f commit f90d40e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/flow_control/if_let.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn main() {
9999
}
100100
```
101101

102-
Another benefit: `if let` allows to match enum non-parameterized variants, even if the enum doesn't `#[derive(PartialEq)]`, neither we implement `PartialEq` for it. In such case, classic `if Foo::Bar==a` fails, because instances of such enum are not comparable for equality. However, `if let` works.
102+
Another benefit is that `if let` allows us to match non-parameterized enum variants. This is true even in cases where the enum doesn't implement or derive `PartialEq`. In such cases `if Foo::Bar == a` would fail to compile, because instances of the enum cannot be equated, however `if let` will continue to work.
103103

104104
Would you like a challenge? Fix the following example to use `if let`:
105105

0 commit comments

Comments
 (0)