1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-28 11:02:02 +03:00

Fix new clippy 0.1.63 warnings

This commit is contained in:
Kévin Commaille
2022-08-12 10:24:16 +02:00
committed by Quentin Gliech
parent 759809b7fd
commit 5c8b442747
8 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,7 @@ use crate::{StorageBackend, StorageBackendMarker, User};
static DEVICE_ID_LENGTH: usize = 10; static DEVICE_ID_LENGTH: usize = 10;
#[derive(Debug, Clone, PartialEq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(transparent)] #[serde(transparent)]
pub struct Device { pub struct Device {
id: String, id: String,

View File

@ -24,7 +24,7 @@ use url::Url;
use crate::traits::{StorageBackend, StorageBackendMarker}; use crate::traits::{StorageBackend, StorageBackendMarker};
#[derive(Debug, Clone, PartialEq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum JwksOrJwksUri { pub enum JwksOrJwksUri {
/// Client's JSON Web Key Set document, passed by value. /// Client's JSON Web Key Set document, passed by value.

View File

@ -200,7 +200,7 @@ fn base62_encode(mut num: u32) -> String {
const CRC: Crc<u32> = Crc::<u32>::new(&CRC_32_ISO_HDLC); const CRC: Crc<u32> = Crc::<u32>::new(&CRC_32_ISO_HDLC);
/// Invalid token /// Invalid token
#[derive(Debug, Error, PartialEq)] #[derive(Debug, Error, PartialEq, Eq)]
pub enum TokenFormatError { pub enum TokenFormatError {
/// Overall token format is invalid /// Overall token format is invalid
#[error("invalid token format")] #[error("invalid token format")]

View File

@ -161,7 +161,7 @@ where
} }
} }
#[derive(Debug, Clone, PartialEq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub enum UserEmailVerificationState { pub enum UserEmailVerificationState {
AlreadyUsed { when: DateTime<Utc> }, AlreadyUsed { when: DateTime<Utc> },
Expired, Expired,

View File

@ -100,7 +100,7 @@ where
.await .await
.map_err(Error::body)?; .map_err(Error::body)?;
let body = serde_json::from_slice(&bytes.to_vec()).map_err(Error::json)?; let body = serde_json::from_slice(&bytes).map_err(Error::json)?;
let res = Response::from_parts(parts, body); let res = Response::from_parts(parts, body);
Ok(res) Ok(res)

View File

@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
use thiserror::Error; use thiserror::Error;
#[derive(Debug, Error, PartialEq)] #[derive(Debug, Error, PartialEq, Eq)]
pub enum CodeChallengeError { pub enum CodeChallengeError {
#[error("code_verifier should be at least 43 characters long")] #[error("code_verifier should be at least 43 characters long")]
TooShort, TooShort,

View File

@ -150,7 +150,7 @@ pub struct AuthorizationResponse<R> {
} }
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct AuthorizationCodeGrant { pub struct AuthorizationCodeGrant {
pub code: String, pub code: String,
#[serde(default)] #[serde(default)]
@ -161,7 +161,7 @@ pub struct AuthorizationCodeGrant {
pub code_verifier: Option<String>, pub code_verifier: Option<String>,
} }
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct RefreshTokenGrant { pub struct RefreshTokenGrant {
pub refresh_token: String, pub refresh_token: String,
@ -169,7 +169,7 @@ pub struct RefreshTokenGrant {
scope: Option<Scope>, scope: Option<Scope>,
} }
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct ClientCredentialsGrant { pub struct ClientCredentialsGrant {
#[serde(default)] #[serde(default)]
scope: Option<Scope>, scope: Option<Scope>,
@ -197,7 +197,7 @@ pub enum GrantType {
ClientCredentials, ClientCredentials,
} }
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
#[serde(tag = "grant_type", rename_all = "snake_case")] #[serde(tag = "grant_type", rename_all = "snake_case")]
pub enum AccessTokenRequest { pub enum AccessTokenRequest {
AuthorizationCode(AuthorizationCodeGrant), AuthorizationCode(AuthorizationCodeGrant),
@ -209,7 +209,7 @@ pub enum AccessTokenRequest {
#[serde_as] #[serde_as]
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct AccessTokenResponse { pub struct AccessTokenResponse {
access_token: String, access_token: String,
refresh_token: Option<String>, refresh_token: Option<String>,
@ -263,7 +263,7 @@ impl AccessTokenResponse {
} }
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, PartialEq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct IntrospectionRequest { pub struct IntrospectionRequest {
pub token: String, pub token: String,
@ -273,7 +273,7 @@ pub struct IntrospectionRequest {
#[serde_as] #[serde_as]
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, PartialEq, Default)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Default)]
pub struct IntrospectionResponse { pub struct IntrospectionResponse {
pub active: bool, pub active: bool,

View File

@ -33,7 +33,7 @@ use thiserror::Error;
#[error("database query returned an inconsistent state")] #[error("database query returned an inconsistent state")]
pub struct DatabaseInconsistencyError; pub struct DatabaseInconsistencyError;
#[derive(Serialize, Debug, Clone, PartialEq)] #[derive(Serialize, Debug, Clone, PartialEq, Eq)]
pub struct PostgresqlBackend; pub struct PostgresqlBackend;
impl StorageBackend for PostgresqlBackend { impl StorageBackend for PostgresqlBackend {