4 ms·
The problem C# has is that wrapping every iteration result in a container would make iteration ever more expensive than it currently is. The Option type in Rus
by ajanuary 13y ago
The problem C# has is that wrapping every iteration result in a container would make iteration ever more expensive than it currently is.
The Option type in Rust is incredibly cheap compared to the equivalent struct or class in C#.
- moomin 13y agoOK, I'll happily admit to a lack of deep knowledge here, but returning a struct of <success, value> doesn't strike me as less expensive than doing two function calls to get the same data. I'm more inclined to suspect they didn't do it that way because C#1 didn't have generics. I'll happily admit Rust's more efficient, though.