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; } }
Personally I'd write this as something like `a.into_iter().chain(b).min()` (it'd be nice if Option impl'd Iterator instead of IntoIterator so you could skip the first method call)
-
-
Ah yeah that's nice.
-
Tests pass, ship it!
- 2 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.