Skip to content

Simplify redundant cfg attributes#2997

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

Simplify redundant cfg attributes#2997
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 22, 2026

Clippy's `non_minimal_cfg` lint catches `#[cfg(any(feature = "x"))]` and `#[cfg(all(feature = "x"))]` when there's only one condition. The wrapping `any()`/`all()` is unnecessary.

Fixed 4 instances:

  • `src/connect.rs`: `any(feature = "__rustls")` -> `feature = "__rustls"`
  • `tests/badssl.rs`: `all(feature = "__tls")` -> `feature = "__tls"`
  • `tests/badssl.rs`: `any(feature = "__native-tls")` -> `feature = "__native-tls"`
  • `examples/connect_via_lower_priority_tokio_runtime.rs`: `any(target_arch = "wasm32")` -> `target_arch = "wasm32"`

Remove unnecessary any() and all() wrappers around single cfg
conditions. #[cfg(any(feature = "x"))] is the same as
#[cfg(feature = "x")].
@ghost ghost closed this by deleting the head repository Mar 26, 2026
This pull request was closed.
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.

0 participants