In Rust the main function is defined like this:
fn main() {
}
This function does not allow for a return value though. Why would a language not allow for a return value and is there a way to return something anyway? Would I be able to safely use the C exit(int) function, or will this cause leaks and whatnot?
exitis not good inasmuch as it does not run destructors. The main side-effect this will have is that buffers will not be flushed. e.g. if you have written to stdout or stderr your output may never be written, as they are buffered. - Chris MorganBufWriter),exitwill not flush the buffers. - Chris Morgan