Add a strict clippy config
维护者通常 2 天内回复
@seanmonstar 已经在做这个了。
开始于 2026年5月19日。
评估
这个 Issue 还没有评估数据。
描述
hyper for a long time never bothered with clippy. Mostly for historical reasons and opinions.
I've now come around to just turning clippy up to 11. What I'm currently leaning towards is keeping an allowlist, and otherwise denying pedantic and even restriction lints. Yes, I know there's a restriction lint against linting for the restriction group. An allowlist still makes a lot of sense to me. If after a bit it turns out to be just unbearable, we can convert it to a bigger deny list, I guess.
The initial config is in place, with a CI job that enforce it, so we won't regress with new code. Now, we just need to evaluate all the undecided lints, and either choose to allow them for sure, or fix them.
How to help
Look at the list of lints that need to be decided upon in the Cargo.toml (it's around there, the line might move slightly).
- Pick a lint.
- If it seems obviously an improvement:
- Fix up the code from the lint.
- It might be as simple as
cargo clippy --fix --features full. - It might be obvious enough for an LLM to automate fixing. (But only if you understand what changes it made.)
- It might need manual adjustment in each case.
- It might need to be
#[allow(this_lint)]in specific cases, where the lint is usually useful.
- It might be as simple as
- Remove the allowed lint from the
Cargo.toml - Submit a PR for one lint at a time.
- Fix up the code from the lint.
- If it is not obviously an improvement:
- Move the lint down lower to the explicitly allowed list in the
Cargo.toml - Add a comment why the lint is being allowed
- Submit a PR (multiple lints solved this way is fine in a single PR)
- Move the lint down lower to the explicitly allowed list in the
Steps
- #4075
- address each one in in the todo list
- arithmetic_side_effects = "allow" # TODO: consider
- as_conversions = "allow" # TODO: tricky
- borrow_as_ptr = "allow"
- cast_lossless = "allow" # TODO: easy fix
- cast_possible_truncation = "allow" # TODO: consider
- cast_precision_loss = "allow" # TODO: consider
- checked_conversions = "allow"
- collapsible_match = "allow"
- decimal_literal_representation = "allow" # TODO: consider
- default_trait_access = "allow"
- else_if_without_else = "allow"
- empty_structs_with_brackets = "allow" # TODO: easy fix
- enum_glob_use = "allow"
- explicit_iter_loop = "allow" # TODO: easy fix
- float_arithmetic = "allow"
- ignored_unit_patterns = "allow"
- indexing_slicing = "allow"
- integer_division = "allow"
- integer_division_remainder_used = "allow"
- large_enum_variant = "allow"
- let_unit_value = "allow"
- manual_assert = "allow" # TODO: easy fix
- manual_assert_eq = "allow" # TODO: easy fix
- map_err_ignore = "allow"
- map_unwrap_or = "allow"
- match_wild_err_arm = "allow"
- missing_fields_in_debug = "allow" # TODO: use finish_non_exhaustive
- missing_errors_doc = "allow" # TODO: good to fix
- missing_panics_doc = "allow" # TODO: might be false
- multiple_inherent_impl = "allow"
- multiple_unsafe_ops_per_block = "allow"
- needless_continue = "allow"
- needless_pass_by_value = "allow"
- panic = "allow"
- pattern_type_mismatch = "allow"
- ptr_as_ptr = "allow"
- question_mark = "allow" # TODO: probably easy fix
- redundant_closure_for_method_calls = "allow"
- redundant_else = "allow"
- ref_option = "allow"
- ref_patterns = "allow" # TODO: perhaps deny?
- semicolon_if_nothing_returned = "allow" # TODO: easy fix
- single_char_lifetime_names = "allow"
- single_match_else = "allow" # TODO: easy fix
- struct_excessive_bools = "allow" # TODO: bogus lint?
- trivially_copy_pass_by_ref = "allow"
- undocumented_unsafe_blocks = "allow" # TODO: fix me
- uninlined_format_args = "allow" # TODO: easy fix
- unnecessary_semicolon = "allow" # TODO: easy fix
- unnecessary_trailing_comma = "allow"
- unnested_or_patterns = "allow"
- unused_async = "allow" # TODO: is it for API?
- unused_trait_names = "allow" # TODO: kinda annoying, but might be good to deny
- unwrap_in_result = "allow"
- useless_borrows_in_formatting = "allow"
- wildcard_enum_match_arm = "allow"
- wildcard_imports = "allow" # TODO: never, except for tests
- 主要语言
- Rust
- 星标
- 16.3k
- 派生
- 1.8k
- 平均合并
- 5 天 17 分钟
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hyperium/hyper 的其他 Issue
-
C-feature
难度 1/5 1 小时以内 新手友好度 65/100
hyperium/hyper#2652 · 4 个 reaction ·
维护者通常 2 天内回复
-
Write a HIP for `Body::poll_progress()`可能已有人在做 @cratelyn 于 3 天前认领。 未关闭A-body B-rfc C-feature
hyperium/hyper#4228 · 已指派 1 人 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 74/100
维护者通常 2 天内回复
-
Upgraded HTTP/2 CONNECT streams cannot be reset, so a failed tunnel looks like a clean close可能已有人在做 @jeremyjpj0916 于 13 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 2 天内回复
-
Allow connection pools to stop reusing an HTTP/2 connection before its keep-alive timeout可能已有人在做 @jiahaoliang 于 31 天前认领。 未关闭C-feature
难度 5/5 一周以上 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
C-bug
难度 2/5 1-3 小时 新手友好度 78/100
rust-lang/rust-analyzer#23501 ·
维护者通常 1 天内回复
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP status可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug P2 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/rust-sdk#1339 ·
维护者通常 3 天内回复
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seed可能已有人在做 @Kshot3000 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 91/100
ergoplatform/sigma-rust#976 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[Bug]: Web chat input doesn't regain focus after a reply finishes可能已有人在做 @GaijinSystems 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
zeroclaw-labs/zeroclaw#11658 ·
维护者通常 2 天内回复