Hacker News new | past | comments | ask | show | jobs | submit login

The page linked for :: explains the turbofish.

That said, you're right that it could use a row for the lifetime syntax.




If you know where to look, you will find it. If you don't, you don't.

For someone new to Rust, I don't see why you'd expect them to expect to see a "path separator" between the function name and it's call in x.collect::<Vec<_>>(). A more likely path to discovery is via the Generics link (discovered from "<" being so prominent there), which shows the ::<> syntax in context of const values, and that isn't actually very helpful for understanding.


So the thing is, the link provided is not really intended to be "teach me what syntax means." It is meant to provide a reference for various tokens. And it does that, because the turbofish isn't a single thing, it's a combination of two things.

If the goal of this page was "comprehensively explain Rust syntax to someone who doesn't know Rust," I would agree with you. But it's "produce a spec-like document for experts who want fine-grained details about the language."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: