Rollup merge of #117037 - csditchfield:fix_doc_writing_result_example, r=notriddle
rustdoc book doc example error closes #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>(()) /// ``` ```
This commit is contained in:
commit
77d8a73fa2
@ -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(())
|
||||
|
Loading…
Reference in New Issue
Block a user