Clippy nits

This commit is contained in:
asonix 2020-04-25 17:15:54 -05:00
parent 1f4553ecc8
commit 4f836940de
3 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@ use thiserror::Error;
mod private;
mod public;
const RSA_OID: [u64; 7] = [1, 2, 840, 113549, 1, 1, 1];
const RSA_OID: [u64; 7] = [1, 2, 840, 113_549, 1, 1, 1];
/// Extensions to keys for formatting and reading PKCS1 and PKCS8 PEM strings
pub trait KeyExt {

View file

@ -64,7 +64,7 @@ impl KeyExt for RSAPrivateKey {
let data = pem::parse(pem).map_err(|_| KeyError::Pem)?;
if data.tag != "PRIVATE KEY" {
return Err(KeyError::Kind.into());
return Err(KeyError::Kind);
}
let expected_oid = yasna::models::ObjectIdentifier::from_slice(&RSA_OID);
@ -124,7 +124,7 @@ impl KeyExt for RSAPrivateKey {
let data = pem::parse(pem).map_err(|_| KeyError::Pem)?;
if data.tag != "RSA PRIVATE KEY" {
return Err(KeyError::Kind.into());
return Err(KeyError::Kind);
}
let pkey = parse_pkcs1(&data.contents)?;

View file

@ -32,7 +32,7 @@ impl KeyExt for RSAPublicKey {
let data = pem::parse(pem).map_err(|_| KeyError::Pem)?;
if data.tag != "PUBLIC KEY" {
return Err(KeyError::Kind.into());
return Err(KeyError::Kind);
}
let expected_oid = yasna::models::ObjectIdentifier::from_slice(&RSA_OID);
@ -79,7 +79,7 @@ impl KeyExt for RSAPublicKey {
let data = pem::parse(pem).map_err(|_| KeyError::Pem)?;
if data.tag != "RSA PUBLIC KEY" {
return Err(KeyError::Kind.into());
return Err(KeyError::Kind);
}
let pkey = parse_pkcs1(&data.contents)?;