rotary-encoder-hal icon indicating copy to clipboard operation
rotary-encoder-hal copied to clipboard

Support for nb

Open BRA1L0R opened this issue 3 years ago • 4 comments

Hello,

I don't know if this project is still maintained but I was thinking of making a pr adding support for the docs.rs/nb crate. Would that be ok?

BRA1L0R avatar Dec 03 '22 08:12 BRA1L0R

It'd also be more correct to use Option<Direction> instead of having a None direction in the enum, which would make the nb code more correct

BRA1L0R avatar Dec 03 '22 08:12 BRA1L0R

It's a pretty small crate, I'm not actively doing anything with it but I'm happy to merge stuff if it makes sense. I don't recall nb being very popular when I first wrote this (years ago now)... Do the embedded hal crates use nb? Would you add support behind a feature gate or change the main implementation?

I don't think the Option is necessarily "more correct", just a different way of representing the same thing. It's subjective.

leshow avatar Dec 05 '22 06:12 leshow

Would you add support behind a feature gate or change the main implementation?

Adding it behind a feature gate was my idea

Just a different way of representing the same thing. It's subjective.

Yes you're indeed right but it doesn't really fit with the non-blocking method as the None variant would never be returned. It's something that could get explained in the documentation though

BRA1L0R avatar Dec 06 '22 09:12 BRA1L0R

Ok. Feel free to PR and I will take a look!

On Tue, Dec 6, 2022, 4:57 a.m. Pietro @.***> wrote:

Would you add support behind a feature gate or change the main implementation?

Adding it behind a feature gate was my idea

Just a different way of representing the same thing. It's subjective.

Yes you're indeed right but it doesn't really fit with the non-blocking method as the None variant would never be returned. It's something that could get explained in the documentation though

— Reply to this email directly, view it on GitHub https://github.com/leshow/rotary-encoder-hal/issues/19#issuecomment-1339060316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITO3RPJNDPCSBONXNJYDDWL4EZJANCNFSM6AAAAAASST7XEI . You are receiving this because you commented.Message ID: @.***>

leshow avatar Dec 07 '22 19:12 leshow