1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Fix clippy errors

This commit is contained in:
Quentin Gliech
2023-03-14 10:28:24 +01:00
parent c6f31d0102
commit 83cb9158a0
6 changed files with 7 additions and 16 deletions

View File

@ -35,7 +35,6 @@ use sentry_tower::{NewSentryLayer, SentryHttpLayer};
use tower::Layer; use tower::Layer;
use tower_http::{compression::CompressionLayer, services::ServeDir}; use tower_http::{compression::CompressionLayer, services::ServeDir};
#[allow(clippy::trait_duplication_in_bounds)]
pub fn build_router<B>( pub fn build_router<B>(
state: AppState, state: AppState,
resources: &[HttpResource], resources: &[HttpResource],

View File

@ -18,9 +18,7 @@
#![allow( #![allow(
clippy::module_name_repetitions, clippy::module_name_repetitions,
clippy::missing_panics_doc, clippy::missing_panics_doc,
clippy::missing_errors_doc, clippy::missing_errors_doc
clippy::trait_duplication_in_bounds,
clippy::type_repetition_in_bounds
)] )]
use thiserror::Error; use thiserror::Error;

View File

@ -103,6 +103,9 @@ impl UpstreamOAuth2Link {
} else { } else {
// Fetch on-the-fly // Fetch on-the-fly
let mut repo = ctx.data::<Mutex<BoxRepository>>()?.lock().await; let mut repo = ctx.data::<Mutex<BoxRepository>>()?.lock().await;
// This is a false positive, since it would have a lifetime error
#[allow(clippy::let_and_return)]
let provider = repo let provider = repo
.upstream_oauth_provider() .upstream_oauth_provider()
.lookup(self.link.provider_id) .lookup(self.link.provider_id)
@ -122,6 +125,9 @@ impl UpstreamOAuth2Link {
} else if let Some(user_id) = &self.link.user_id { } else if let Some(user_id) = &self.link.user_id {
// Fetch on-the-fly // Fetch on-the-fly
let mut repo = ctx.data::<Mutex<BoxRepository>>()?.lock().await; let mut repo = ctx.data::<Mutex<BoxRepository>>()?.lock().await;
// This is a false positive, since it would have a lifetime error
#[allow(clippy::let_and_return)]
let user = repo let user = repo
.user() .user()
.lookup(*user_id) .lookup(*user_id)

View File

@ -82,7 +82,6 @@ pub use mas_axum_utils::http_client_factory::HttpClientFactory;
pub use self::{app_state::AppState, compat::MatrixHomeserver, graphql::schema as graphql_schema}; pub use self::{app_state::AppState, compat::MatrixHomeserver, graphql::schema as graphql_schema};
#[must_use]
pub fn healthcheck_router<S, B>() -> Router<S, B> pub fn healthcheck_router<S, B>() -> Router<S, B>
where where
B: HttpBody + Send + 'static, B: HttpBody + Send + 'static,
@ -92,7 +91,6 @@ where
Router::new().route(mas_router::Healthcheck::route(), get(self::health::get)) Router::new().route(mas_router::Healthcheck::route(), get(self::health::get))
} }
#[must_use]
pub fn graphql_router<S, B>(playground: bool) -> Router<S, B> pub fn graphql_router<S, B>(playground: bool) -> Router<S, B>
where where
B: HttpBody + Send + 'static, B: HttpBody + Send + 'static,
@ -115,7 +113,6 @@ where
router router
} }
#[must_use]
pub fn discovery_router<S, B>() -> Router<S, B> pub fn discovery_router<S, B>() -> Router<S, B>
where where
B: HttpBody + Send + 'static, B: HttpBody + Send + 'static,
@ -149,8 +146,6 @@ where
) )
} }
#[must_use]
#[allow(clippy::trait_duplication_in_bounds)]
pub fn api_router<S, B>() -> Router<S, B> pub fn api_router<S, B>() -> Router<S, B>
where where
B: HttpBody + Send + 'static, B: HttpBody + Send + 'static,
@ -210,7 +205,6 @@ where
) )
} }
#[must_use]
#[allow(clippy::trait_duplication_in_bounds)] #[allow(clippy::trait_duplication_in_bounds)]
pub fn compat_router<S, B>() -> Router<S, B> pub fn compat_router<S, B>() -> Router<S, B>
where where
@ -254,8 +248,6 @@ where
) )
} }
#[must_use]
#[allow(clippy::trait_duplication_in_bounds)]
pub fn human_router<S, B>(templates: Templates) -> Router<S, B> pub fn human_router<S, B>(templates: Templates) -> Router<S, B>
where where
B: HttpBody + Send + 'static, B: HttpBody + Send + 'static,

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#![allow(clippy::trait_duplication_in_bounds)]
use std::{str::FromStr, sync::Arc}; use std::{str::FromStr, sync::Arc};
use axum::{ use axum::{

View File

@ -14,8 +14,6 @@
//! Contexts used in templates //! Contexts used in templates
#![allow(clippy::trait_duplication_in_bounds, clippy::type_repetition_in_bounds)]
use chrono::Utc; use chrono::Utc;
use mas_data_model::{ use mas_data_model::{
AuthorizationGrant, BrowserSession, Client, CompatSsoLogin, CompatSsoLoginState, AuthorizationGrant, BrowserSession, Client, CompatSsoLogin, CompatSsoLoginState,