crossterm-rs / crossterm

Cross platform terminal library rust
MIT License
3.27k stars 279 forks source link

Build break from #862 #883

Closed heaths closed 6 months ago

heaths commented 6 months ago

Describe the bug Seems #862 broke the build by now always returning a result from <ModifierKeyCode as Display>::fmt. Also seems the #[cfg] attribute on the match itself isn't correct, as the individual match arms have conditions. Still, even without it still doesn't compile without some tweaks.

To Reproduce Steps to reproduce the behavior:

  1. Try to build.

Expected behavior Build fails with:

    |
922 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |        ---                                       ^^^^^^^^^^^ expected `Result<(), Error>`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
    |
    = note:   expected enum `Result<(), std::fmt::Error>`
            found unit type `()`

OS

Terminal/Console