Skip to content

chore: fix cargo clippy warning #215

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

Merged
merged 1 commit into from
Apr 14, 2025
Merged

Conversation

xixishidibei
Copy link
Contributor

Running cargo clippy reports the following error.

warning: calling `as_bytes` after slicing a string
   --> src/primitives/decode.rs:138:30
    |
138 |             data_part_ascii: rest[1..].as_bytes(), // Skip the separator.
    |                              ^^^^^^^^^^^^^^^^^^^^ help: try: `&rest.as_bytes()[1..]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes
    = note: `#[warn(clippy::sliced_string_as_bytes)]` on by default

This commit resolves the issue.

@apoelstra
Copy link
Member

CI failures are unrelated.

Copy link
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 9390a63; successfully ran local tests

Copy link
Member

@clarkmoody clarkmoody left a comment

Choose a reason for hiding this comment

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

ACK 9390a63

@apoelstra apoelstra merged commit f7d846e into rust-bitcoin:master Apr 14, 2025
9 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants