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
Squish a Bunch of Clippy Errors and Warnings #5385
Open
Pi-Cla
wants to merge
15
commits into
wez:main
Choose a base branch
from
Pi-Cla:main
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warning: this expression creates a reference which is immediately dereferenced by the compiler (wezterm-dynamic/src/error.rs:19 and 25) error: this loop never actually loops (wezterm-dynamic/src/error.rs:204:13) warning: question mark operator is useless here (wezterm-dynamic/src/fromdynamic.rs:54:9) warning: the following explicit lifetimes could be elided: 'k (wezterm-dynamic/src/object.rs:18-31) warning: non-canonical implementation of `partial_cmp` on an `Ord` type (wezterm-dynamic/src/object.rs:50:1)
warning: deref which would be done by auto-deref (wezterm-blob-leases/src/lease_id.rs:31:33) warning: the borrowed expression implements the required traits (several times in wezterm-blob-leases/src/simple_tempdir.rs)
warning: manual implementation of an assign operation (color-types/src/lib.rs:634 and 682) warning: length comparison to zero (color-types/src/lib.rs:662:12) warning: manual `!RangeInclusive::contains` implementation (color-types/src/lib.rs:733:28) warning: stripping a prefix manually (color-types/src/lib.rs:750:34) warning: implementation of inherent method `to_string(&self) -> String` for type `SrgbaTuple` (color-types/src/lib.rs:410:5)
warning: constants have by default a `'static` lifetime (bidi/src/bidi_brackets.rs:8:27 and bidi/src/bidi_class.rs:31:24) warning: this `else { if .. }` block can be collapsed (bidi/src/lib.rs:1461:28) warning: the following explicit lifetimes could be elided: 'a (bidi/src/lib.rs) warning: the loop variable `i` is used to index `levels` (bidi/src/lib.rs:360:18) warning: this expression creates a reference which is immediately dereferenced by the compiler (bidi/src/lib.rs:846:45) warning: unneeded `return` statement (bidi/src/lib.rs) warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do (bidi/src/lib.rs:1265:21) warning: match expression looks like `matches!` macro (bidi/src/lib.rs) warning: single-character string constant used as pattern (bidi/generate/src/main.rs:22 and 115)
warning: `feature = "cargo-clippy"` was replaced by `clippy` (pty/src/unix.rs:34 and 264) warning: redundant field names in struct initialization (pty/src/cmdbuilder.rs:309:17) warning: the borrowed expression implements the required traits (pty/src/cmdbuilder.rs:449 and 518) warning: called `.as_ref().map(|dir| dir.as_os_str())` on an `Option` value (pty/src/cmdbuilder.rs:500:27) warning: useless conversion to the same type: `std::string::String` (pty/src/cmdbuilder.rs:555:9) warning: this import is redundant (pty/src/lib.rs:43:1) warning: manual implementation of `Option::map` (pty/src/lib.rs:273:53) warning: `Box::new(_)` of default value (pty/src/lib.rs:401:5)
warning: redundant pattern matching, consider using `is_ok()` (luahelper/src/enumctor.rs:136:20) warning: question mark operator is useless here (luahelper/src/enumctor.rs:143:24) warning: the following explicit lifetimes could be elided: 'lua (3 instances in luahelper/src/lib.rs) warning: non-canonical implementation of `partial_cmp` on an `Ord` type (luahelper/src/lib.rs:285:1) warning: this expression creates a reference which is immediately dereferenced by the compiler (luahelper/src/lib.rs:346:41)
warning: this `if` statement can be collapsed (rangeset/src/lib.rs:284:13) warning: the following explicit lifetimes could be elided: 'a (rangeset/src/lib.rs:332:24)
warning: unneeded `return` statement (wezterm-open-url/src/lib.rs:50:34)
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used (procinfo/src/linux.rs:39:17) warning: use of `unwrap_or_else` to construct default value (procinfo/src/linux.rs:79 and 85) warning: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned (procinfo/src/linux.rs:99 and procinfo/src/macros.rs:223) warning: manual implementation of `Option::map` procinfo/src/linux.rs:133:9
warning: deref on an immutable reference (bintree/src/lib.rs:162 and 166) warning: deref which would be done by auto-deref (bintree/src/lib.rs:214:9)
warning: the borrowed expression implements the required traits
warning: this `if` statement can be collapsed (wezterm-ssh/src/config.rs:733:29) warning: this `else { if .. }` block can be collapsed (wezterm-ssh/src/sessioninner.rs:477:28) warning: this expression creates a reference which is immediately dereferenced by the compiler (in 3 places wezterm-ssh/src/auth.rs also in config.rs and host.rs) warning: you seem to be trying to use `match` for an equality check. Consider using `if` (wezterm-ssh/src/auth.rs:160:9) warning: the following explicit lifetimes could be elided: 'b (wezterm-ssh/src/auth.rs:317:31) warning: unneeded `return` statement (wezterm-ssh/src/auth.rs:348:33) warning: stripping a prefix manually (wezterm-ssh/src/config.rs:257 and 269) warning: match expression looks like `matches!` macro (wezterm-ssh/src/config.rs:606) error: this loop never actually loops (wezterm-ssh/src/host.rs:68 and sessioninner.rs:336) warning: the borrowed expression implements the required traits (wezterm-ssh/src/sessioninner.rs:336 and 339) warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead (wezterm-ssh/src/sessioninner.rs:364 and 374) warning: this expression borrows a value the compiler would automatically borrow (wezterm-ssh/src/sftp/file.rs:175:17) warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true (wezterm-ssh/src/sftp/types.rs:397:5) warning: question mark operator is useless here (wezterm-ssh/src/sftpwrap.rs:19:5)
warning: match expression looks like `matches!` macro (wezterm-input-types/src/lib.rs:115 and 862) warning: single-character string constant used as pattern (wezterm-input-types/src/lib.rs:420) warning: direct implementation of `ToString` (4 instances in wezterm-input-types/src/lib.rs) warning: comparison to empty slice (wezterm-input-types/src/lib.rs:521:40) error: manual `RangeInclusive::contains` implementation (wezterm-input-types/src/lib.rs:1279:28) warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true (wezterm-input-types/src/lib.rs:1982:1)
warning: non-canonical implementation of `clone` on a `Copy` type (deps/freetype/src/lib.rs:42:29
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are some remaining such as these:
But I got rid of a lot of them