chainerror/booksrc/tutorial4.md
2019-03-04 11:44:15 +01:00

442 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!().

{{#include ../examples/tutorial4.rs}}
# #[allow(dead_code)]
# mod chainerror {
{{#includecomment ../src/lib.rs}}
# }