Skip to content

Commit

Permalink
Unrolled build for rust-lang#117037
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#117037 - csditchfield:fix_doc_writing_result_example, r=notriddle

rustdoc book doc example error

closes rust-lang#117036

This is the minimal change required to make the second what-to-include.md example valid.
Another more modern solution could be considered:
```
/// Example
/// ```rust
/// let fortytwo = "42".parse::<u32>()?;
/// println!("{} + 10 = {}", fortytwo, fortytwo+10);
/// #     Ok::<(), <u32 as std::str::FromStr>::Err>(())
/// ```
```
  • Loading branch information
rust-timer committed Oct 22, 2023
2 parents 3932c87 + 6596270 commit b37142c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/rustdoc/src/write-documentation/what-to-include.md
Expand Up @@ -73,7 +73,7 @@ and your test suite, this example needs some additional code:
``````text
/// Example
/// ```rust
/// # main() -> Result<(), std::num::ParseIntError> {
/// # fn main() -> Result<(), std::num::ParseIntError> {
/// let fortytwo = "42".parse::<u32>()?;
/// println!("{} + 10 = {}", fortytwo, fortytwo+10);
/// # Ok(())
Expand Down

0 comments on commit b37142c

Please sign in to comment.