5 releases (2 stable)
1.0.1 | May 2, 2019 |
---|---|
0.0.3 | May 2, 2019 |
0.0.2 | May 2, 2019 |
0.0.1 | Apr 30, 2019 |
#2879 in Rust patterns
Used in 2 crates
4KB
set-error
A very simple trait that overwrites errors with Strings
for Result
s and Option
s.
When used with the ?
operator it makes a nice pattern. Documentation
File::open("config.yaml")
.set_error("Failed to open config file.")?
.read_to_string(&mut contents)
.set_error("Failed to read file content.")?;
Help
If you run into any issues or need help with using read_input
in your project please email incoming+efunb-set-error-12103568-issue-@incoming.gitlab.com
Warning
If you are viewing this from GitHub then this is a read only copy. Please contribute to the GitLab copy here.