7 ms·
This is one of the things I like about SNAFU: it makes this preferred pattern the default and makes it nicer to use. For example, your usage would look somethin
by shepmaster 2y ago
This is one of the things I like about SNAFU: it makes this preferred pattern the default and makes it nicer to use. For example, your usage would look something like this with SNAFU:
create_dir(path).context(CreateStagingDirectorySnafu { path })?;
Note a few points:
1. No need to use the closure
2. No need to carry the source error over yourself (`context` does this for you)
3. No need to explicitly call `clone` on the path (`context` does this for you)