hostblock icon indicating copy to clipboard operation
hostblock copied to clipboard

Compilation error (expected Key vs Option)

Open nsbgn opened this issue 6 years ago • 0 comments

Thanks for the application - it's pretty useful!

However, I'm getting a compilation error on Debian Stretch (which has rustc 1.24.1 and cargo 0.25.0). Is there a specific version I should be running instead, or can this be fixed?

$ cargo update
$ cargo build --release
warning: dependency (clippy) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
warning: unused manifest key: dependencies.clippy.clippy
   Compiling hostblock v0.1.1 (...)
error[E0308]: mismatched types
   --> src/main.rs:114:21
    |
114 |                     Some(Key::Ctrl('c')) => break,
    |                     ^^^^^^^^^^^^^^^^^^^^ expected enum `rustbox::Key`, found enum `std::option::Option`
    |
    = note: expected type `rustbox::Key`
               found type `std::option::Option<_>`

error[E0308]: mismatched types
   --> src/main.rs:115:21
    |
115 |                     Some(k) => {
    |                     ^^^^^^^ expected enum `rustbox::Key`, found enum `std::option::Option`
    |
    = note: expected type `rustbox::Key`
               found type `std::option::Option<_>`

warning: use of deprecated item 'rand::Rng::shuffle': use SliceRandom::shuffle instead
   --> src/main.rs:602:9
    |
602 |     rng.shuffle(&mut choices);
    |         ^^^^^^^
    |
    = note: #[warn(deprecated)] on by default

error: aborting due to 2 previous errors

error: Could not compile `hostblock`.

To learn more, run the command again with --verbose.

(I can make it compile by simply removing the Some() which wraps the k and Key::Ctrl('c'), but I'm not familiar with Rust so I don't actually know what that does.)

nsbgn avatar Jan 10 '19 12:01 nsbgn