In #Rustlang you can return std::process::ExitCode
from main()
.
It's better than calling std::process::exit()
, because it allows the program to run destructors, which may be needed to flush pending I/O or print buffered logs.
https://play.rust-lang.org/?gist=56c6ffb9d0b1206502ca996244bd0242
https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html
ExitCode in std::process - Rust
This type represents the status code the current process can return to its parent under normal termination.doc.rust-lang.org
This entry was edited (7 months ago)