From 204232659d85020c363cd3380b250361827d431d Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Wed, 8 Dec 2021 11:07:55 +0100 Subject: [PATCH] app: fix clippy warning --- app/src/infra/cookies.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/infra/cookies.rs b/app/src/infra/cookies.rs index b3840bf..2605c8c 100644 --- a/app/src/infra/cookies.rs +++ b/app/src/infra/cookies.rs @@ -5,8 +5,7 @@ use web_sys::HtmlDocument; fn get_document() -> Result { web_sys::window() - .map(|w| w.document()) - .flatten() + .and_then(|w| w.document()) .ok_or_else(|| anyhow!("Could not get window document")) .and_then(|d| { d.dyn_into::() @@ -16,8 +15,7 @@ fn get_document() -> Result { pub fn set_cookie(cookie_name: &str, value: &str, expiration: &DateTime) -> Result<()> { let doc = web_sys::window() - .map(|w| w.document()) - .flatten() + .and_then(|w| w.document()) .ok_or_else(|| anyhow!("Could not get window document")) .and_then(|d| { d.dyn_into::()