Skip to content

Remove duplicate must_use#1063

Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom
tcharding:06-24-fix-clippy-warning
Jun 24, 2022
Merged

Remove duplicate must_use#1063
apoelstra merged 1 commit intorust-bitcoin:masterfrom
tcharding:06-24-fix-clippy-warning

Conversation

@tcharding
Copy link
Copy Markdown
Member

@tcharding tcharding commented Jun 23, 2022

Clippy emits:

warning: this function has an empty #[must_use] attribute, but returns a type already marked as #[must_use]

This is because the return type of the function legacy_encode_signing_data_to is EncodeSigningDataResult which is
already marked as must_use. There is no need to have must_use on the function also.

Hey apoelstra, this PR is needed before any other PR can get a green CI run. The PR that introduced this warning must have had a green CI run before the 'add clippy to CI' PR merged allowing it to merge without re-running CI.

Clippy emits:

 warning: this function has an empty `#[must_use]` attribute, but
 returns a type already marked as `#[must_use]`

This is because the return type of the function
`legacy_encode_signing_data_to` is `EncodeSigningDataResult` which is
already marked as `must_use`. There is no need to have `must_use` on the
function also.

I'm guessing this got through to master because we only just added
clippy to CI.
@apoelstra
Copy link
Copy Markdown
Member

Neat -- I also added cargo clippy to my local post-merge sanity check (which is currently only cargo test)

Copy link
Copy Markdown
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK bea5569

Copy link
Copy Markdown
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK bea5569

@Kixunil Kixunil added trivial Obvious, easy and quick to review (few lines or doc-only...) clippy Issues and PRs related to fixing clippy warnings labels Jun 24, 2022
@apoelstra apoelstra merged commit b645b6b into rust-bitcoin:master Jun 24, 2022
@tcharding tcharding deleted the 06-24-fix-clippy-warning branch June 28, 2022 00:06
@tcharding tcharding mentioned this pull request Jun 28, 2022
ChallengeDev210 pushed a commit to ChallengeDev210/rust-bitcoin that referenced this pull request Aug 1, 2022
bea5569 Remove duplicate must_use (Tobin C. Harding)

Pull request description:

  Clippy emits:

   warning: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`

  This is because the return type of the function `legacy_encode_signing_data_to` is `EncodeSigningDataResult` which is
  already marked as `must_use`. There is no need to have `must_use` on the function also.

  ##

  Hey apoelstra, this PR is needed before any other PR can get a green CI run. The PR that introduced this warning must have had a green CI run before the 'add clippy to CI' PR merged allowing it to merge without re-running CI.

ACKs for top commit:
  apoelstra:
    ACK bea5569
  Kixunil:
    ACK bea5569

Tree-SHA512: 27b606685bc2d5317a5e332431511af9b1017bf58462c283b322e5b6faf645fd8e006455af3d6888ab2c3c680b11e4b89f538f26440f4f1422e0daabc61825ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clippy Issues and PRs related to fixing clippy warnings trivial Obvious, easy and quick to review (few lines or doc-only...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants