rename cherr() to context()

This commit is contained in:
Harald Hoyer 2020-09-01 21:03:01 +02:00
parent 2af5fb7ad6
commit ed710fada3
25 changed files with 169 additions and 199 deletions

View file

@ -1,12 +1,7 @@
# Saving coding chars
# More information
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!()`.
To give more context to the error, you want to use `format!`
to extend the information in the context string.
~~~rust
{{#include ../examples/tutorial4.rs}}
@ -14,4 +9,4 @@ more debug strings.
# mod chainerror {
{{#rustdoc_include ../src/lib.rs:-1}}
# }
~~~
~~~