Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bail!() and ensure!() docs incorrectly claim it's equivalent to Err(From::from($err)) #54

Closed
lilyball opened this issue Jul 23, 2021 · 2 comments
Labels
C-documentation Category: Improvements or additions to documentation C-enhancement Category: New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@lilyball
Copy link

The docs on bail!() and ensure!() claim that these macros are equivalent to code returning Err(From::from($err)):

https://github.com/yaahc/eyre/blob/54933ea76d12960fb4b954c81c2d288481ff9b03/src/macros.rs#L3
https://github.com/yaahc/eyre/blob/54933ea76d12960fb4b954c81c2d288481ff9b03/src/macros.rs#L66

This appears to have been inherited from anyhow originally, although anyhow has since updated its docs.

These macros should instead claim that they're equivalent to Err(eyre!($err)) (or possibly Err(eyre!($args...)) like anyhow's current docs). Also, like current anyhow, it would be nice to use intra-doc links here.

@NOBLES5E
Copy link

found the same issue

@yaahc yaahc added C-documentation Category: Improvements or additions to documentation C-enhancement Category: New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 20, 2022
birkenfeld added a commit to birkenfeld/eyre that referenced this issue Dec 3, 2022
@thenorili
Copy link
Contributor

Fixed in PR #87 -- thanks so much for your contribution :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-documentation Category: Improvements or additions to documentation C-enhancement Category: New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants