4 ms·
Nobody complains about the Rust turbo-fish operator which is pretty verbose too. Java has already has introduced a direct toList()/toArray() anyways. let v
by lenkite 1y ago
Nobody complains about the Rust turbo-fish operator which is pretty verbose too. Java has already has introduced a direct toList()/toArray() anyways.
let v = (1..5).collect::<Vec<i32>>(); // Cool Rust
- eastbound 1y agoStreams should be built in collections, not a .stream().map(…).toList() convolution. In know its incompatible with weird frameworks who already overloaded the .map() method, but well… let them recompile. That was in 2008, we’d be happy by now; and Java had no qualms asking everyone to change the package names from javax’ to jakartax’ in Java 21, so they should have issued a java.collections package and deprecated the lists i java.utils.
- jmaker 1y agoIf v’s type can be inferred, you don’t need to give that extra hint to the type checker, likewise for 1..5. And Java Streams’ toList produces an immutable list.