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

Introduce write_err macro #446

Merged
merged 1 commit into from Jun 15, 2022
Merged

Commits on Jun 13, 2022

  1. Improve Error display

    The current display code for `Error` is a little unusual. We typically
    just implement `Display` and if a `str` is needed use `format!`.
    
    Improve the `Error` type by doing
    
    - Remove the `as_str` function and implement `Display` directly.
    - Remove the 'secp: ' prefix of all the error messages.
    - Use a newly defined macro `write_err` that writes the error if `std`
      feature is not enabled so that no-std builds do not loose error info.
    
    Note: The `write_err` macro is currently being introduced in
    `rust-bitcoin` also. Elect to just duplicate it here and not share it
    between the crates.
    tcharding committed Jun 13, 2022
    Configuration menu
    Copy the full SHA
    946cd83 View commit details
    Browse the repository at this point in the history