integer-result-rs

๐Ÿ”ขโœ…๐Ÿšซ

Using scalar types to indicate failure in Rust is discouraged, yet not uncommon in C. When calling C functions from Rust, you have to check return values that indicate success or failure like you would in C. This library adds methods to the primitive and non-zero integer types to ease the pain.

Now you can write this ๐Ÿงผ

```rust use integer_result::Ext;

unsafe { somecfunction() } .okequal(0) .maperr(|val| YourRustyErrorType::from(val)) // or somethin' .. ```

Rather than this ๐Ÿคข

```rust let val = unsafe { somecfunction() };

if val == 0 { Ok(()) } else { Err(YourRustyErrorType::from(val)) } ```