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

Enable rustfmt #959

Closed
wants to merge 4 commits into from
Closed

Enable rustfmt #959

wants to merge 4 commits into from

Commits on May 26, 2022

  1. Add rustfmt::skip as needed

    In preparation for enabling `rustfmt` crate wide add various skip
    statements and do minor format fixes.
    
    Note, for some reason adding `rustfmt::skip` to the
    `sha256t_hash_newtype` causes build to fail due to ambiguous naming (we
    have the exact same macro in `bitcoin_hashes`). The macros are identical
    except for the `rust-bitcoin` version adds docs to the created structs.
    Until that can be pushed upstream to `bitcoin_hashes` I've renamed the
    macro to `_sha256t_hash_newtype` and added a comment.
    tcharding committed May 26, 2022
    Configuration menu
    Copy the full SHA
    01a1d1f View commit details
    Browse the repository at this point in the history
  2. Run cargo +nightly fmt

    Add a `rustfmt` configuration file setting a bunch of configuration
    options. All options that are not the default value include a comment
    with the default value.
    
    Run `cargo +nightly fmt`. No other changes made.
    tcharding committed May 26, 2022
    Configuration menu
    Copy the full SHA
    31cc094 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2022

  1. Inline magic number comment

    In order to make rustfmt leave the comment on the same line as the magic
    number we have to put it _before_ the number.
    tcharding committed May 30, 2022
    Configuration menu
    Copy the full SHA
    081e448 View commit details
    Browse the repository at this point in the history
  2. Improve layout of multiline math statements

    In order to get the rustfmt to play nicely with multiline math
    statements that include comments put the operator at the start of the
    line.
    tcharding committed May 30, 2022
    Configuration menu
    Copy the full SHA
    8914b62 View commit details
    Browse the repository at this point in the history