Hacker News new | past | comments | ask | show | jobs | submit login

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)






Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: