From 05d11426a8e60fa060733eb8ae7843bc2ae9725c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 10 Jun 2024 15:28:36 +0200 Subject: apply many clippy issue --- server/src/routes/ui/assets.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/src/routes/ui/assets.rs') diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs index c278a31..ad31240 100644 --- a/server/src/routes/ui/assets.rs +++ b/server/src/routes/ui/assets.rs @@ -75,7 +75,7 @@ pub async fn r_item_assets( width: Option, ) -> MyResult { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -83,10 +83,10 @@ pub async fn r_item_assets( AssetRole::Backdrop => node.public.backdrop, AssetRole::Poster => node.public.poster, }; - if let None = asset { + if asset.is_none() { if let Some(parent) = &node.public.path.last() { let parent = T_NODE - .get(&db, parent.as_str())? + .get(db, parent.as_str())? .ok_or(anyhow!("node does not exist"))?; asset = match role { AssetRole::Backdrop => parent.public.backdrop, @@ -113,7 +113,7 @@ pub async fn r_person_asset( width: Option, ) -> MyResult { T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -129,7 +129,7 @@ pub async fn r_person_asset( .person .headshot .to_owned() - .unwrap_or(AssetInner::Assets(format!("fallback-Person.avif").into()).ser()); + .unwrap_or(AssetInner::Assets("fallback-Person.avif".into()).ser()); Ok(Redirect::temporary(rocket::uri!(r_asset(asset.0, width)))) } @@ -146,7 +146,7 @@ pub async fn r_node_thumbnail( width: Option, ) -> MyResult { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; -- cgit v1.2.3-70-g09d2