You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0170]: pattern binding `First` is named the same as one of the variants of the type `Enum`
--> src/main.rs:10:13
|
10 | First => print!("1"),
| ^^^^^ help: to match on the variant, qualify the path: `Enum::First`
|
= note: `#[deny(bindings_with_variant_name)]` on by default
error[E0170]: pattern binding `Second` is named the same as one of the variants of the type `Enum`
--> src/main.rs:11:13
|
11 | Second => print!("2"),
| ^^^^^^ help: to match on the variant, qualify the path: `Enum::Second`
The answer matches the description, we get "1" for 0u8 and "2" for 1u8. It does not, however, match the "any" part nor the official answer stating the program would print "1".
Below, there are two possible ways for fixing the issue.
Either Enum:: should be added to the code and the answer changed to "2" or the answer should be changed to "The program does not compile".
The text was updated successfully, but these errors were encountered:
In question 7, the original code looks like this:
We get compilation errors on lines
after fixing them by adding Enum::
the output is
"2"
.The answer matches the description, we get
"1"
for0u8
and"2"
for1u8
. It does not, however, match the "any" part nor the official answer stating the program would print"1"
.Below, there are two possible ways for fixing the issue.
Either
Enum::
should be added to the code and the answer changed to"2"
or the answer should be changed to "The program does not compile".The text was updated successfully, but these errors were encountered: