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

Resolve clippy issues #458

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Resolve clippy issues #458

merged 2 commits into from
Dec 9, 2024

Conversation

caspermeijn
Copy link
Contributor

The latest stable clippy has new lints. In two commits, I solved the new lints.

I suggest using a fixed clippy version to prevent future breakage. If you are interested, I could do that in a separate PR.

This solves clippy warnings like this:
```
error: needless call to `as_bytes()`
   --> src/protocol/frame/frame.rs:346:44
    |
346 |             let mut p = Vec::with_capacity(reason.as_bytes().len() + 2);
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `reason.len()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes
    = note: `-D clippy::needless-as-bytes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_as_bytes)]`
```
This solves clippy warnings like this:
```
error: the following explicit lifetimes could be elided: 't
  --> src/protocol/frame/frame.rs:35:6
   |
35 | impl<'t> fmt::Display for CloseFrame<'t> {
   |      ^^                              ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
35 - impl<'t> fmt::Display for CloseFrame<'t> {
35 + impl fmt::Display for CloseFrame<'_> {
   |
```
@daniel-abramov daniel-abramov merged commit 4af7316 into snapview:master Dec 9, 2024
7 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.

2 participants