You've already forked authentication-service
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:
@ -35,7 +35,6 @@ use sentry_tower::{NewSentryLayer, SentryHttpLayer};
|
||||
use tower::Layer;
|
||||
use tower_http::{compression::CompressionLayer, services::ServeDir};
|
||||
|
||||
#[allow(clippy::trait_duplication_in_bounds)]
|
||||
pub fn build_router<B>(
|
||||
state: AppState,
|
||||
resources: &[HttpResource],
|
||||
|
@ -18,9 +18,7 @@
|
||||
#![allow(
|
||||
clippy::module_name_repetitions,
|
||||
clippy::missing_panics_doc,
|
||||
clippy::missing_errors_doc,
|
||||
clippy::trait_duplication_in_bounds,
|
||||
clippy::type_repetition_in_bounds
|
||||
clippy::missing_errors_doc
|
||||
)]
|
||||
|
||||
use thiserror::Error;
|
||||
|
@ -103,6 +103,9 @@ impl UpstreamOAuth2Link {
|
||||
} else {
|
||||
// Fetch on-the-fly
|
||||
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
|
||||
.upstream_oauth_provider()
|
||||
.lookup(self.link.provider_id)
|
||||
@ -122,6 +125,9 @@ impl UpstreamOAuth2Link {
|
||||
} else if let Some(user_id) = &self.link.user_id {
|
||||
// Fetch on-the-fly
|
||||
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
|
||||
.user()
|
||||
.lookup(*user_id)
|
||||
|
@ -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};
|
||||
|
||||
#[must_use]
|
||||
pub fn healthcheck_router<S, B>() -> Router<S, B>
|
||||
where
|
||||
B: HttpBody + Send + 'static,
|
||||
@ -92,7 +91,6 @@ where
|
||||
Router::new().route(mas_router::Healthcheck::route(), get(self::health::get))
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn graphql_router<S, B>(playground: bool) -> Router<S, B>
|
||||
where
|
||||
B: HttpBody + Send + 'static,
|
||||
@ -115,7 +113,6 @@ where
|
||||
router
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn discovery_router<S, B>() -> Router<S, B>
|
||||
where
|
||||
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>
|
||||
where
|
||||
B: HttpBody + Send + 'static,
|
||||
@ -210,7 +205,6 @@ where
|
||||
)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[allow(clippy::trait_duplication_in_bounds)]
|
||||
pub fn compat_router<S, B>() -> Router<S, B>
|
||||
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>
|
||||
where
|
||||
B: HttpBody + Send + 'static,
|
||||
|
@ -12,8 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#![allow(clippy::trait_duplication_in_bounds)]
|
||||
|
||||
use std::{str::FromStr, sync::Arc};
|
||||
|
||||
use axum::{
|
||||
|
@ -14,8 +14,6 @@
|
||||
|
||||
//! Contexts used in templates
|
||||
|
||||
#![allow(clippy::trait_duplication_in_bounds, clippy::type_repetition_in_bounds)]
|
||||
|
||||
use chrono::Utc;
|
||||
use mas_data_model::{
|
||||
AuthorizationGrant, BrowserSession, Client, CompatSsoLogin, CompatSsoLoginState,
|
||||
|
Reference in New Issue
Block a user