Skip to content

Commit 19ce045

Browse files
authored
Remove try_main and return Result
Since main can now return a result, the documentation examples that use `?` can be simplified. This is also the method used by the [rustdoc documentation](https://doc.rust-lang.org/rustdoc/documentation-tests.html).
1 parent 2c49e91 commit 19ce045

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/documentation.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,13 @@ will not appear in user-visible rustdoc.
5151
/// ```rust
5252
/// # use std::error::Error;
5353
/// #
54-
/// # fn try_main() -> Result<(), Box<Error>> {
54+
/// # fn main() -> Result<(), Box<Error>> {
5555
/// your;
5656
/// example?;
5757
/// code;
5858
/// #
5959
/// # Ok(())
6060
/// # }
61-
/// #
62-
/// # fn main() {
63-
/// # try_main().unwrap();
64-
/// # }
6561
/// ```
6662
```
6763

0 commit comments

Comments
 (0)