Re:Apt Rust requirement raises questions
by iknowstuff on Tuesday November 25, 2025 @11:45AM
(#46047691)
Most likely
or
rustc will figure out the type
[ Parent
| on HN ]
Re:Apt Rust requirement raises questions
by J_Shelby_J on Tuesday November 25, 2025 @11:59AM
(#46047855)
exactly. you specify types for function parameters and structs and let the language do it's thing. it's a bit of a niche to specify a type within a function...
There is a reason the multiple methods detailed above exist. Mostly for random iterator syntax. Such as summing an array or calling collect on an iterator. Most Rust devs probably don't use all of these syntax in a single year or maybe even their careers.
Re:Apt Rust requirement raises questions
by vablings on Tuesday November 25, 2025 @12:29PM
(#46048211)
I can't believe that a flexible powerful syntax is considered limiting or confusing by some people. There is way more confusing edge-case syntax keywords in C++ that are huge foot-guns.
Re:Apt Rust requirement raises questions
by xscott on Tuesday November 25, 2025 @12:31PM
(#46048224)
Do these print statements print the same thing?
let i = 1;
let j = 1;
print!("i: {:?}\n", !i);
print!("j: {:?}\n", !j);
let v = vec![1, 2, 3];
v[i];
There are definitely times you want to specify a type.
Re:Apt Rust requirement raises questions
by soiltype on Tuesday November 25, 2025 @06:18PM
(#46052018)
> There are definitely times you want to specify a type.
So I'm coming from basically obly TypeScript type system experience but that seems completely ok to me. There are times I make my TS uglier to make it less ambiguous and times I make it more ambiguous to make it more readable. It's unreasonable imo that such a system could universally land on the most readable format even if we could all agree what's most readable. Instead, some cases are going to be tradeoffs so that the more common cases can flow unimpeded.