sidit77 / async-hid

A async Rust library for interacting with HID devices
MIT License
3 stars 2 forks source link

unstable compiler feature usage #1

Closed harryhaaren closed 1 year ago

harryhaaren commented 1 year ago

Hi! First of all, very cool idea for a library, thanks for sharing! When trying to compile, I get an error around is_some_and usage... it seems the only issue, so likely a small fix to allow stable/beta users to also compile this library?

Its actually in an ensure! macro, so by commenting it, the enumerate_devices example is working here now!

error[E0658]: use of unstable library feature 'is_some_and'
  --> src/backend/hidraw/mod.rs:89:18
   |
89 |                 .is_some_and(|z| !z.is_empty()),
   |                  ^^^^^^^^^^^
   |
   = note: see issue #93050 <https://github.com/rust-lang/rust/issues/93050> for more information
   = help: add `#![feature(is_some_and)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.

I guess there's a way to .is_some( /* deal with "and" here in a different way */ ) ?

sidit77 commented 1 year ago

You should be able to fix this by updating your rust compiler (rustup update) because is_some_and was stabilized in 1.70 (~6 weeks ago).

harryhaaren commented 1 year ago

Doh - of course. Apologies, my mistake, of course I should attempt a rustup update before filing such an issue. Thanks, closing now!