Skip to content
Snippets Groups Projects
Commit 424e2435 authored by Jerome Jutteau's avatar Jerome Jutteau
Browse files

Add note about error management in 'rusting_properly.md'


closes #78

Signed-off-by: default avatarJerome Jutteau <mojo@couak.net>
parent 56d1d783
No related branches found
No related tags found
1 merge request!79Add note about error management in 'rusting_properly.md'
......@@ -14,3 +14,4 @@ Some general guidelines:
* When `unsafe` is unnecessary, don't use it. 10 lines longer safe code is better than more compact unsafe code!
* Be sure to mark parts that need work with `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME`.
* Use the compiler hint attributes, such as `#[inline]`, `#[cold]`, etc. when it makes sense to do so.
* Try to banish `unwrap()` and `except()` from your code in order to manage errors properly. Panicking must indicate a bug in the program (not an error you didn't want to manage). If you cannot recover from an error, print a nice error to stderr and exit. Check [Rust's book about unwrapping](https://doc.rust-lang.org/book/error-handling.html#a-brief-interlude-unwrapping-isnt-evil).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment