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

Remove unnecessary boxing of warp filters

This was needed because of a compiler regression. Now that we're using
Rust 1.58 there is no benefit to boxing them
This commit is contained in:
Quentin Gliech
2022-01-18 12:07:29 +01:00
parent 1b35f96f29
commit 0c2950a160
3 changed files with 14 additions and 18 deletions

View File

@@ -55,14 +55,7 @@ pub fn root(
); );
let static_files = static_files(config.http.web_root.clone()); let static_files = static_files(config.http.web_root.clone());
let filter = health let filter = health.or(views).unify().or(static_files).unify().or(oauth2);
.or(views)
.unify()
.or(static_files)
.unify()
.boxed()
.or(oauth2)
.boxed();
filter.with(warp::log(module_path!())).boxed() filter.with(warp::log(module_path!())).boxed()
} }

View File

@@ -53,18 +53,13 @@ pub fn filter(
let filter = discovery let filter = discovery
.or(keys) .or(keys)
.unify() .unify()
.boxed()
.or(userinfo) .or(userinfo)
.unify() .unify()
.boxed()
.or(token) .or(token)
.unify() .unify()
.boxed()
.or(introspection) .or(introspection)
.unify() .unify()
.boxed() .with(cors().allow_methods([Method::POST, Method::GET]));
.with(cors().allow_methods([Method::POST, Method::GET]))
.boxed();
filter.or(authorization).boxed() filter.or(authorization).boxed()
} }

View File

@@ -47,8 +47,16 @@ pub(super) fn filter(
let logout = logout(pool, cookies_config); let logout = logout(pool, cookies_config);
let reauth = reauth(pool, templates, csrf_config, cookies_config); let reauth = reauth(pool, templates, csrf_config, cookies_config);
let f1 = index.or(account).unify().boxed(); index
let f2 = login.or(register).unify().boxed(); .or(account)
let f3 = logout.or(reauth).unify().boxed(); .unify()
f1.or(f2).unify().or(f3).unify().boxed() .or(login)
.unify()
.or(register)
.unify()
.or(logout)
.unify()
.or(reauth)
.unify()
.boxed()
} }