Skip to content

style(lib): enforce clippy::needless_pass_by_value - #4257

Open
trivikr wants to merge 1 commit into
hyperium:masterfrom
trivikr:clippy_needless_pass_by_value
Open

trivikr wants to merge 1 commit into
hyperium:masterfrom
trivikr:clippy_needless_pass_by_value

Conversation

@trivikr

@trivikr trivikr commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

see #4071.

Lint doc: https://clippy.rust-lang.org/master/index.html#needless_pass_by_value

The rule checks for functions taking arguments by value, but not
consuming them in its body. It replaces them to take arguments by
reference to avoid unnecessary allocations.

@cratelyn
cratelyn self-requested a review November 3, 2026 23:28
Comment thread src/proto/h2/mod.rs
}

fn strip_connection_headers(headers: &mut HeaderMap, kind: MessageKind) {
fn strip_connection_headers(headers: &mut HeaderMap, kind: &MessageKind) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is the only that makes less sense. This enum is basically a better-named bool. It's more normal to pass those by value. And, it's smaller too (1 byte vs 1 word).

This branch has not been deployed

No deployments
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