miette_helper

Crates.iomiette_helper
lib.rsmiette_helper
version0.1.0
sourcesrc
created_at2022-10-25 23:36:15.968709
updated_at2022-10-25 23:36:15.968709
descriptionCrate providing helper macros for miette
homepage
repository
max_upload_size
id697393
size14,831
(LeSnake04)

documentation

README

Miette Helper

A library providing helper macros for Miette as well as some general error-handling helper macros

I recommend to use it in conjuntion with unwrap or

Provided Functions

wrap_err

Converts given Result into Diagnostic and returns it. Made for applications not using a custom error enum/struct.

let a: Result<u32, std::io::Error> = Ok(42);
let b: u32 = wrap_err!(a, "Failed to calulate number")? + 27;

or_wrap_err

Converts given Option into Diagnostic with the given error message.

let b: Option<&str> = None;
let c: &str = or_wrap_err!(b, "No path specified")?
Commit count: 0

cargo fmt