![]() It is the whole power of destructors that they get invoked without the programmer having not to forget about them. I perfectly know that stack unwinding is very costly in Rust - but the program is going to terminate anyway in a while, so I don’t find it a big problem in this case. And this is not an error, no exception - just time to finish our work. Of course, we can write our own, make it a crate, … And what if we were using Command::new to launch a command and just want to exit with the child’s exit code… std::process::exit at the last line…?īut remember, we were just to exit the program. an enum, we can’t simply use the try! or ? macro, so we clutter the code at any exit point. Here, if we use Result - we create nonsense in our code, using the Err variant for cases where no error has occurred.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |