Add ensure_pow method#13042
Conversation
|
I've implemented |
Dont know what is better here. Maybe there can be types that are not |
|
Added tests. I think all pending comments are "solved" for now. I've opened an issue rust-num/num-traits#254 trying to get more info in order to know the best possible design decision for doing it as a function or as a trait method. But I think is not blocking, so if you are ok with it right now, it's ok for me. |
|
(Looks like the CI does not notice when you dismiss reviews 🤔) Merging now since there were no changes since Basti last reviewed. |
|
bot merge |
Yes, it was weird, the review button switched between you and your partner, instead of selecting both 🤷♂️. Anyways, thanks for your reviews! 🙌🏻 |
* add ensure_pow method * reexport checked_pow and ensure_pow
|
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-37/1736/1 |
* add ensure_pow method * reexport checked_pow and ensure_pow
* add ensure_pow method * reexport checked_pow and ensure_pow
This PR extends #12967 with the
ensure_powfunction. I think this is also an interesting function to have along with theensure_opsfamily methods.ensure_powacts similarly tochecked_powbut returns anArithmeticErrorinstead.Related #12754