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

Fixup clippy 1.75 lints (get_first) #407

Closed
micolous opened this issue Dec 30, 2023 · 0 comments · Fixed by #409
Closed

Fixup clippy 1.75 lints (get_first) #407

micolous opened this issue Dec 30, 2023 · 0 comments · Fixed by #409
Assignees

Comments

@micolous
Copy link
Collaborator

micolous commented Dec 30, 2023

I did this

cargo clippy

I expected the following

No errors.

What actually happened

error: accessing first element with `arr_x509.get(0)`
   --> webauthn-rs-core\src\attestation.rs:448:32
    |
448 |               let attestn_cert = arr_x509
    |  ________________________________^
449 | |                 .get(0)
    | |_______________________^ help: try: `arr_x509.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
note: the lint level is defined here
   --> webauthn-rs-core\src\lib.rs:16:9
    |
16  | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(clippy::get_first)]` implied by `#[deny(warnings)]`

    Checking alloc-no-stdlib v2.0.4
error: accessing first element with `arr_x509.get(0)`
   --> webauthn-rs-core\src\attestation.rs:590:33
    |
590 |       let cerificate_public_key = arr_x509
    |  _________________________________^
591 | |         .get(0)
    | |_______________^ help: try: `arr_x509.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

error: accessing first element with `arr_x509.get(0)`
   --> webauthn-rs-core\src\attestation.rs:738:20
    |
738 |       let aik_cert = arr_x509
    |  ____________________^
739 | |         .get(0)
    | |_______________^ help: try: `arr_x509.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

   Compiling heck v0.4.1
error: accessing first element with `certs.get(0)`
    --> webauthn-rs-core\src\attestation.rs:1177:29
     |
1177 |             let leaf_cert = certs.get(0).ok_or(SafetyNetError::BadCert)?;
     |                             ^^^^^^^^^^^^ help: try: `certs.first()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

    Checking clap_lex v0.4.1
    Checking strsim v0.10.0
    Checking alloc-stdlib v0.2.2
    Checking clap_builder v4.2.7
   Compiling clap_derive v4.2.0
    Checking polyval v0.6.0
   Compiling libloading v0.7.4
error: could not compile `webauthn-rs-core` (lib) due to 4 previous errors

Version (and git commit)

142e8d7

Operating System / Version

> rustc -Vv
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-pc-windows-msvc
release: 1.75.0
LLVM version: 17.0.6

Any other comments

Also fails in CI

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 a pull request may close this issue.

2 participants