4 ms·
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 separ
by yencabulator 2y ago
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.
- steveklabnik 2y agoSo 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."