Closed PaulDance closed 3 years ago
Merging #208 into master will not change coverage. The diff coverage is
0.00%
.
@@ Coverage Diff @@
## master #208 +/- ##
=======================================
Coverage 60.81% 60.81%
=======================================
Files 40 40
Lines 2636 2636
=======================================
Hits 1603 1603
Misses 1033 1033
Impacted Files | Coverage Δ | |
---|---|---|
src/event.rs | 0.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update cf1575d...27a9fd5. Read the comment docs.
This fixes #205. The latest glutin version bumps winit's which introduces a number of breaking changes including renaming some enumeration variants:
This meant that matches on previous names obviously failed, but not at compile-time however: because the function imported the enumeration's variants locally, previous names thus matched anything. That caused
Add
to be understood as a name binding instead of a variant: the compiler only raised warnings, but not proper errors. Note that all the tests ran just fine, even with the warnings being emitted. Of course the CI being configured to reject warnings helped us catch this, but in order to avoid such a confusion in the future, this PR not only fixes the matter at hand by adding theNumpad
prefix to all changed names, but also puts the enumeration name in the match arms instead of importing them. That would help raise a more specific error sooner. This strategy has been applied to other match expressions in the module as well. Also, the unsupported keys have all been put in a_
match arm pattern instead of listing the rest of them, which was useless and error-prone as additional variants were also added in the version bump.Winit's changelog seems to indicate that the introduced breaking changes were meant to help differentiate between the usual minus key and the numpad's one:
This could mean that:
VirtualKeyCode::NumpadSubtract
is mapped toKey::Minus
, which might not be the initial intent.