Hello Rust friends. Is it bad to implement Add and then use this boilerplate for AddAssign? impl AddAssign for Foo { fn add_assign(&mut self, rhs: Self) { *self = *self + rhs; } }
-
-
yep exactly, what I actually want is #[derive(Ord)] enum DoublyExtended<T> { NegInf, The(T), PosInf }
-
I guess I could just use that with an ok() method to coerce to Option<T>... hmmm
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.