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;
#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(transparent)]
pub struct Device {
id: String,

View File

@ -24,7 +24,7 @@ use url::Url;
use crate::traits::{StorageBackend, StorageBackendMarker};
#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum JwksOrJwksUri {
/// 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);
/// Invalid token
#[derive(Debug, Error, PartialEq)]
#[derive(Debug, Error, PartialEq, Eq)]
pub enum TokenFormatError {
/// Overall token format is invalid
#[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 {
AlreadyUsed { when: DateTime<Utc> },
Expired,

View File

@ -100,7 +100,7 @@ where
.await
.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);
Ok(res)

View File

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

View File

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

View File

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