refactor: move function

This commit is contained in:
Anna 2022-07-04 15:47:35 -04:00
parent dcd0143b80
commit 1d9d7c35a1
1 changed files with 6 additions and 6 deletions

View File

@ -227,12 +227,6 @@ fn common_js() -> BoxedFilter<(impl Reply, )> {
.boxed()
}
fn index() -> BoxedFilter<(impl Reply, )> {
let route = warp::path::end()
.map(|| warp::redirect(Uri::from_static("/listings")));
warp::get().and(route).boxed()
}
fn list_js() -> BoxedFilter<(impl Reply, )> {
warp::path("list.js")
.and(warp::path::end())
@ -240,6 +234,12 @@ fn list_js() -> BoxedFilter<(impl Reply, )> {
.boxed()
}
fn index() -> BoxedFilter<(impl Reply, )> {
let route = warp::path::end()
.map(|| warp::redirect(Uri::from_static("/listings")));
warp::get().and(route).boxed()
}
fn listings(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
async fn logic(state: Arc<State>, codes: Option<String>) -> std::result::Result<impl Reply, Infallible> {
let lang = Language::from_codes(codes.as_deref());