Implement operations for Wrapping where Rhs = T by Kriskras99 · Pull Request #140567 · rust-lang/rust (original) (raw)
Currently doing the following is not possible:
let n = Wrapping(142usize); let m = n % 100;
It is however possible to do:
let mut n = Wrapping(142usize); n %= 100;
In the spirit of Is an RFC required? this seems like an obvious API hole. Therefore I've implemented this without an RFC. I am willing to write an RFC if it is required though.
I could not figure out where/how to implement tests for this, so if someone could please tell me where and how to do that.