From 351c17335741ac42f60a14df70a9f8aa7383543c Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 21 Jun 2023 13:25:49 -0700 Subject: [PATCH] cargo clippy --fix --- src/i18n.rs | 3 +-- src/routes/get_challenge.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/i18n.rs b/src/i18n.rs index d588ba9..f5867a2 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -75,8 +75,7 @@ pub fn i18n_filter( let langs = args .get("lang") - .map(|value| value.as_array()) - .flatten() + .and_then(|value| value.as_array()) .map(|array| { let mut langs = Vec::with_capacity(array.len()); for lang in array { diff --git a/src/routes/get_challenge.rs b/src/routes/get_challenge.rs index f9f370d..8151f99 100644 --- a/src/routes/get_challenge.rs +++ b/src/routes/get_challenge.rs @@ -25,7 +25,7 @@ pub async fn get_challenge( lang: cookies .get(LANG_COOKIE) .map(|cookie| vec![cookie.value().to_owned()]) - .or_else(|| accept_language.0) + .or(accept_language.0) .unwrap_or_else(|| vec![DEFAULT_LANG.to_owned()]), user: User::get(cookies).await.unwrap(), content: Challenge::get(challenge),