3 ms·
Hi pcwalton, 1) If you dropped semicolons like Swift, you could keep implicit returns. I just don't see the advantage of having them in multiline functions at
by fjrieiekd 10y ago
Hi pcwalton,
1) If you dropped semicolons like Swift, you could keep implicit returns.
I just don't see the advantage of having them in multiline functions at the cost of having to retain semicolons. IMO, a trailing value after a multiline function also just looks plain bizarre for newbies.
I agree it's probably too late for this, but you asked how Rust could be easier to learn and this is one of the ways.
2) It would certainly be much nicer to have this.
3) See Swift for an example of where this was done more nicely IMO than in Rust.
4) Unfortunate. Splitting out a helper function means we lose Rust's inference which already exists when used in a let statement, and requires adding dependent crates from libraries to the binary's Cargo.toml and importing them into the module and hard coding the types. The client shouldn't have to care about this.
5) Great!
I still enjoy the language just the same, but you asked how it can be easier to learn and this is how I see it.