| Crates.io | fn-error-context |
| lib.rs | fn-error-context |
| version | 0.2.1 |
| created_at | 2020-03-29 16:38:36.093552+00 |
| updated_at | 2023-03-21 00:02:02.379391+00 |
| description | An attribute macro to add context to errors from a function. |
| homepage | |
| repository | https://github.com/andrewhickman/fn-error-context |
| max_upload_size | |
| id | 224120 |
| size | 39,955 |
An attribute macro to add context to errors from a function.
#[context("failed to parse config at `{}`", path.display())]
pub fn parse_config(path: &Path) -> anyhow::Result<u32> {
let text = read_to_string(path)?;
Ok(text.parse()?)
}