parity-common icon indicating copy to clipboard operation
parity-common copied to clipboard

Help with primitive-types

Open Kevan0v opened this issue 4 years ago • 1 comments

I am struggling with primitive-types:

cannot use `|=` on type `primitive_types::U256`

Is there a work around for using these combined operators? Also is there a simple way to flip a bit at a given position? Thanks!

Kevan0v avatar Jun 18 '20 13:06 Kevan0v

uint doesn't implement BitOrAssign, but implements BitOr trait, meaning you can do

a = a | b

BitOrAssign (as well as BitAndAssign and BitXorAssign) would be easy to implement, PRs are welcome! :)

ordian avatar Jun 18 '20 13:06 ordian