cargo clippy

This commit is contained in:
Pierre HUBERT 2022-04-09 12:25:56 +02:00
parent 5633aae029
commit 88e34902c0
2 changed files with 2 additions and 9 deletions

View File

@ -36,7 +36,7 @@ impl Session {
#[rtype(result = "()")] #[rtype(result = "()")]
pub struct PushNewSession(pub Session); pub struct PushNewSession(pub Session);
#[derive(Default)]
pub struct OpenIDSessionsActor { pub struct OpenIDSessionsActor {
session: Vec<Session>, session: Vec<Session>,
} }
@ -47,12 +47,6 @@ impl OpenIDSessionsActor {
} }
} }
impl Default for OpenIDSessionsActor {
fn default() -> Self {
Self { session: vec![] }
}
}
impl Actor for OpenIDSessionsActor { impl Actor for OpenIDSessionsActor {
type Context = Context<Self>; type Context = Context<Self>;

View File

@ -87,8 +87,7 @@ pub async fn authorize(user: CurrentUser, query: web::Query<AuthorizeQuery>,
}.render().unwrap()); }.render().unwrap());
} }
let scopes = query.scope.split(' ').collect::<Vec<_>>(); if !query.scope.split(' ').any(|x| x == "openid") {
if !scopes.contains(&"openid") {
return error_redirect(&query, "invalid_request", "openid scope missing!"); return error_redirect(&query, "invalid_request", "openid scope missing!");
} }