Closed twitchyliquid64 closed 4 years ago
Oh thats what it does :(
error[E0658]: the `!` type is experimental
--> hx711/src/lib.rs:61:11
|
61 | impl Into<!> for Error<!, !> {
| ^
|
= note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information
I used the never_type
for the .into_ok()
usage on operations which cannot fail, e.g. operations which have error type Infallible
. See the documentation for a short description. It allows to avoid .unwrap()
when one knows it will never fail, and can provide this guarantee at compile time. For example with the stm32fXxx-hal:
# this will never fail, but just from the code this is not obvious
sck_pin.set_high().unwrap()
# here, it is clear that this is always ok
sck_pin.set_high().into_ok()
This requires nightly. When I introduced this, it seemed that never_type is going to stabilize soon. Now it seems rather blocked.
I see that you want to use the driver with stable rust. It is surely possible to remove the usage of never_type
. An (optional) never_type
feature would be an easy solution. Being compatible with stable rust is probably a wise decision for a platform agnostic driver anyways. Thanks for pointing this out!
Could you have a look at PR #4 ? This should make this driver usable on stable rust.
Fantastic, that would be perfect!
I'm not super sure what
never_type
does, is it possible to remove this constraint?