Crates.io | its_ok |
lib.rs | its_ok |
version | 0.1.0 |
source | src |
created_at | 2022-06-06 18:57:56.580742 |
updated_at | 2022-06-06 18:57:56.580742 |
description | A macro for replacing ? with unwrap. |
homepage | |
repository | https://github.com/abvalatouski/its-ok |
max_upload_size | |
id | 600912 |
size | 11,941 |
its_ok
Provides ok
and ok_unchecked
macros for replacing ?
with unwrap
and
unwrap_unchecked
calls.
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();