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

small nightly clippy fixes #222

Merged
merged 2 commits into from
Jan 8, 2024
Merged

small nightly clippy fixes #222

merged 2 commits into from
Jan 8, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Jan 8, 2024

CI started failing the nightly clippy task (example) ~yesterday from a couple enum variants where we never accessed the inner fields.

This branch fixes both findings by removing the unused untrusted::Input inner fields.

In practice we never examine the `untrusted::Input` field of
a `GeneralName::DirectoryName` variant. Nightly clippy is flagging this:

```
error: field `0` is never read
   --> src/subject_name/verify.rs:256:19
    |
256 |     DirectoryName(untrusted::Input<'a>),
    |     ------------- ^^^^^^^^^^^^^^^^^^^^
    |     |
    |     field in this variant
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
256 |     DirectoryName(()),
    |                   ~~
```

This commit switches the `GeneralName::DirectoryName` to be a variant
without any fields to resolve this finding. If we expand support for
`DirectoryName`'s in the future we can revisit.
In practice we never examine the `untrusted::Input` field of
a `DistributionPointName::NameRelativeToCrlIssuer` variant. Nightly
clippy is flagging this:

```
error: field `0` is never read
  --> src/x509.rs:89:29
   |
89 |     NameRelativeToCrlIssuer(untrusted::Input<'a>),
   |     ----------------------- ^^^^^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
89 |     NameRelativeToCrlIssuer(()),
   |                             ~~
```

This commit switches
`DistributionPointName::NameRelativeToCrlIssuer` to be a variant without
any fields to resolve this finding.
@cpu cpu self-assigned this Jan 8, 2024
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5dc3a67) 97.16% compared to head (4c7f490) 97.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   97.16%   97.18%   +0.02%     
==========================================
  Files          19       19              
  Lines        4303     4299       -4     
==========================================
- Hits         4181     4178       -3     
+ Misses        122      121       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cpu cpu added this pull request to the merge queue Jan 8, 2024
Merged via the queue into rustls:main with commit 4d1ecc2 Jan 8, 2024
30 checks passed
@cpu cpu deleted the cpu-ci-clippy-fixes branch January 8, 2024 21:05
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