3 ms·
> trait Iterator = fn next<T>(&mut self) -> Option<T> + fn len(&self) -> usize This is why I don’t have interest in learning rust. When I see people write c++
by dgfitz 2y ago
> trait Iterator = fn next<T>(&mut self) -> Option<T> + fn len(&self) -> usize
This is why I don’t have interest in learning rust. When I see people write c++ code like this I wonder why they feel the need to be so clever.
That is an abysmal thing to maintain.
- steveklabnik 2y agoThat isn’t real Rust code, though it’s made up of valid bits of Rust syntax.
- dgfitz 2y agoOh, ok that’s fair. I guess I should at least learn the grammar better before commenting more on rust.
- moomin 2y agoI mean, C#'s IEnumerator is equivalent and is way more complex. You just don't need to think about it much.
- marcosdumay 2y agoNope, just because you lack familiarity with the symbols, it doesn't make that declaration complex. It's not even "clever". It's completely plain, and the bare minimum and obvious definition of what an "iterator" should be.