-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Update doc examples that use ? (Carrier) to use Termination #49233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Big 👍 from me |
Seems a good idea to me as well. |
I think this will be a good thing for combating the most common error of pasting the trimmed examples into |
cool, i'll start working on this then 🤸♂️ |
opened a pr for this: #49357 |
…GuillaumeGomez Remove hidden `foo` functions from doc examples; use `Termination` trait. Fixes #49233. Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
Blocked on #49162
Example:
rust/src/libstd/fs.rs
Lines 40 to 49 in c19264f
Instead of:
We can now do:
Which can be copied/pasted straight from the docs such that it will compile, unlike the old example
The text was updated successfully, but these errors were encountered: