1
0
Fork 0
mirror of https://github.com/haraldh/chainerror.git synced 2025-02-25 09:24:20 +01:00
chainerror/booksrc/tutorial4.md
2018-12-20 16:37:08 +01:00

471 B

Saving coding chars

Because decorating an error with more information should not let you jump through hoops, chainerror has a quick macro for that.

mstrerror!() fits right into .map_err() letting you quickly add more debug strings.

mstrerror!() even understands format!() syntax like println!().

use crate::chainerror::*;
{{#include ../examples/tutorial4.rs:2:}}
# #[allow(dead_code)]
# mod chainerror {
{{#includecomment ../src/lib.rs}}
# }