rust-wiringpi icon indicating copy to clipboard operation
rust-wiringpi copied to clipboard

Implement `!` (std::ops::Not) for `Value`

Open Lindenk opened this issue 6 years ago • 1 comments

Because of the way rust handles Enums vs Integers, there is no convenient way to invert a logic level with rust-wiringpi. I propose std::ops::Not be implemented for Value so that it can be inverted:

!High would be Low !Low would be High

Lindenk avatar Jan 10 '20 20:01 Lindenk

Good call! Will look at your PR. :slightly_smiling_face:

Ogeon avatar Jan 11 '20 10:01 Ogeon