Skip to content

Commit b153d15

Browse files
Clarify the original fn main() -> ()
Co-authored-by: Josh Triplett <[email protected]>
1 parent 9de575a commit b153d15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

posts/2022-05-19-Rust-1.61.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please [report] any bugs you might come across!
3030

3131
### Custom exit codes from `main`
3232

33-
In the beginning, Rust `main` functions could only return the unit `()`, always indicating success
33+
In the beginning, Rust `main` functions could only return the unit type `()` (either implicitly or explicitly), always indicating success
3434
in the exit status, and if you wanted otherwise you had to call `process::exit(code)`. Since Rust
3535
1.26, `main` has been allowed to return a `Result`, where `Ok` translated to a C `EXIT_SUCCESS` and
3636
`Err` to `EXIT_FAILURE` (also debug-printing the error). Under the hood, these alternate return

0 commit comments

Comments
 (0)