Skip to content

Compilation error (expected Key vs Option) #12

@nsbgn

Description

@nsbgn

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions