its_ok

Crates.ioits_ok
lib.rsits_ok
version0.1.0
sourcesrc
created_at2022-06-06 18:57:56.580742
updated_at2022-06-06 18:57:56.580742
descriptionA macro for replacing ? with unwrap.
homepage
repositoryhttps://github.com/abvalatouski/its-ok
max_upload_size
id600912
size11,941
Aliaksei Valatouski (abvalatouski)

documentation

https://docs.rs/its-ok

README

its_ok

Provides ok and ok_unchecked macros for replacing ? with unwrap and unwrap_unchecked calls.

Example

use its_ok::ok;
use std::io::Write;

ok! {
    let mut buffer = Vec::new();
    buffer.write_all(b"bytes")?;
}

// The code above gets expanded into this.
let mut buffer = Vec::new();
buffer.write_all(b"bytes").unwrap();
Commit count: 2

cargo fmt