-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Rustdoc now allows us to use ?
in our tests. Unfortunately, this requires writing the fn main() -> ..
manually, which really shouldn't be needed IMHO.
So we now have to write:
/// ```rust
///# fn main() -> Result<(), ()> {
/// let foo = Ok(1usize);
/// assert!(foo? > 0);
///# }
/// ```
where it should suffice to write:
/// ```rust
/// let foo = Ok(1usize);
/// assert!(foo? > 0);
/// ```
Doing so will make the tests shorter and hopefully lead to more ?
and less unwrap
in tests.
Centril and jonhoo
Metadata
Metadata
Assignees
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.