Skip to content

test(token): separate tests for verification against self/examples

Sign in for the full log view
GitHub Actions / clippy failed Jun 17, 2024 in 0s

clippy

4 errors, 33 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 33
Note 0
Help 0

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956 2024-04-29)

Annotations

Check warning on line 53 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:53:5
   |
53 |     Other(&'static str),
   |     ^^^^^

Check warning on line 52 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:52:5
   |
52 |     TypeMismatch(Value),
   |     ^^^^^^^^^^^^

Check warning on line 51 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:51:5
   |
51 |     OpensslError(core::ffi::c_ulong),
   |     ^^^^^^^^^^^^

Check warning on line 48 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:48:5
   |
48 |     MissingEc2KeyParam(iana::Ec2KeyParameter),
   |     ^^^^^^^^^^^^^^^^^^

Check warning on line 47 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:47:5
   |
47 |     MissingKeyParam(iana::KeyParameter),
   |     ^^^^^^^^^^^^^^^

Check warning on line 46 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:46:5
   |
46 |     InvalidKeyId(Vec<u8>),
   |     ^^^^^^^^^^^^

Check warning on line 45 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:45:5
   |
45 |     DuplicateHeaders(Vec<Label>),
   |     ^^^^^^^^^^^^^^^^

Check warning on line 44 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:44:5
   |
44 |     KeyTypeCurveMismatch(KeyType, iana::EllipticCurve),
   |     ^^^^^^^^^^^^^^^^^^^^

Check warning on line 43 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:43:5
   |
43 |     KeyTypeAlgorithmMismatch(KeyType, Algorithm),
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 42 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:42:5
   |
42 |     UnsupportedKeyOperation(iana::KeyOperation),
   |     ^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 41 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:41:5
   |
41 |     UnsupportedAlgorithm(Algorithm),
   |     ^^^^^^^^^^^^^^^^^^^^

Check warning on line 40 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:40:5
   |
40 |     UnsupportedCurve(Option<iana::EllipticCurve>),
   |     ^^^^^^^^^^^^^^^^

Check warning on line 39 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/token/crypto_impl/openssl.rs:39:5
   |
39 |     UnsupportedKeyType,
   |     ^^^^^^^^^^^^^^^^^^

Check warning on line 38 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for an enum

warning: missing documentation for an enum
  --> src/token/crypto_impl/openssl.rs:38:1
   |
38 | pub enum CoseOpensslCipherError {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 17 in src/token/crypto_impl/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a module

warning: missing documentation for a module
   --> src/token/crypto_impl/mod.rs:17:1
    |
17  | pub mod openssl;
    | ^^^^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> src/lib.rs:308:9
    |
308 | #![warn(missing_docs, rustdoc::missing_crate_level_docs)]
    |         ^^^^^^^^^^^^

Check failure on line 293 in src/token/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

error: docs for function returning `Result` missing `# Errors` section
   --> src/token/mod.rs:288:5
    |
288 | /     fn sign(
289 | |         key: &CoseKey,
290 | |         target: &[u8],
291 | |         unprotected_header: &Header,
292 | |         protected_header: &Header,
293 | |     ) -> Result<Vec<u8>, CoseCipherError<Self::Error>>;
    | |_______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
    = note: `#[deny(clippy::missing_errors_doc)]` implied by `#[deny(clippy::pedantic)]`

Check warning on line 417 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/token/crypto_impl/openssl.rs:415:9
    |
415 | /         &BigNum::from_slice(y)
416 | |             .map_err(CoseOpensslCipherError::from)?
417 | |             .deref(),
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
help: change this to
    |
415 ~         BigNum::from_slice(y)
416 +             .map_err(CoseOpensslCipherError::from)?
417 ~             .deref(),
    |

Check warning on line 414 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/token/crypto_impl/openssl.rs:412:9
    |
412 | /         &BigNum::from_slice(x)
413 | |             .map_err(CoseOpensslCipherError::from)?
414 | |             .deref(),
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
help: change this to
    |
412 ~         BigNum::from_slice(x)
413 +             .map_err(CoseOpensslCipherError::from)?
414 ~             .deref(),
    |

Check warning on line 411 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/token/crypto_impl/openssl.rs:411:9
    |
411 |         &group,
    |         ^^^^^^ help: change this to: `group`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 405 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(..).flatten()` on `Option`

warning: called `map(..).flatten()` on `Option`
   --> src/token/crypto_impl/openssl.rs:404:10
    |
404 |           .map(Value::as_bytes)
    |  __________^
405 | |         .flatten()
    | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(Value::as_bytes)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten

Check warning on line 399 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(..).flatten()` on `Option`

warning: called `map(..).flatten()` on `Option`
   --> src/token/crypto_impl/openssl.rs:398:10
    |
398 |           .map(Value::as_bytes)
    |  __________^
399 | |         .flatten()
    | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(Value::as_bytes)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten

Check warning on line 385 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/token/crypto_impl/openssl.rs:383:9
    |
383 | /         &BigNum::from_slice(d)
384 | |             .map_err(CoseOpensslCipherError::from)?
385 | |             .deref(),
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default
help: change this to
    |
383 ~         BigNum::from_slice(d)
384 +             .map_err(CoseOpensslCipherError::from)?
385 ~             .deref(),
    |

Check warning on line 376 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(..).flatten()` on `Option`

warning: called `map(..).flatten()` on `Option`
   --> src/token/crypto_impl/openssl.rs:375:10
    |
375 |           .map(Value::as_bytes)
    |  __________^
376 | |         .flatten()
    | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(Value::as_bytes)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
    = note: `#[warn(clippy::map_flatten)]` on by default

Check failure on line 361 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to match on a boolean expression

error: you seem to be trying to match on a boolean expression
   --> src/token/crypto_impl/openssl.rs:358:57
    |
358 |                       .and_then(|verification_successful| match verification_successful {
    |  _________________________________________________________^
359 | |                         true => Ok(()),
360 | |                         false => Err(CoseCipherError::VerificationFailure),
361 | |                     })
    | |_____________________^ help: consider using an `if`/`else` expression: `if verification_successful { Ok(()) } else { Err(CoseCipherError::VerificationFailure) }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool
    = note: `#[deny(clippy::match_bool)]` implied by `#[deny(clippy::pedantic)]`

Check failure on line 286 in src/token/crypto_impl/openssl.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

explicit `deref` method call

error: explicit `deref` method call
   --> src/token/crypto_impl/openssl.rs:284:21
    |
284 | /                     PKey::from_ec_key(private_key)
285 | |                         .map_err(CoseOpensslCipherError::from)?
286 | |                         .deref(),
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods
    = note: `#[deny(clippy::explicit_deref_methods)]` implied by `#[deny(clippy::pedantic)]`
help: try
    |
284 ~                     &*PKey::from_ec_key(private_key)
285 ~                         .map_err(CoseOpensslCipherError::from)?,
    |