diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-10 15:28:36 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-10 15:28:36 +0200 |
commit | 05d11426a8e60fa060733eb8ae7843bc2ae9725c (patch) | |
tree | 57cfad9cedf1eb50de193f1657b42234745c044e /server/src/routes/ui/node.rs | |
parent | c0365c8c64f403fd9ee75c0db1a9ed6134633e8f (diff) | |
download | jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar.bz2 jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar.zst |
apply many clippy issue
Diffstat (limited to 'server/src/routes/ui/node.rs')
-rw-r--r-- | server/src/routes/ui/node.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index bd839fb..d99ddb7 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -47,7 +47,7 @@ pub async fn r_library_node_ext<'a>( db: &'a State<DataAcid>, ) -> MyResult<Json<ExtendedNode>> { T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -63,14 +63,14 @@ pub async fn r_library_node_filter<'a>( filter: NodeFilterSort, ) -> MyResult<Either<DynLayoutPage<'a>, Json<NodePublic>>> { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))? .public; let node_ext = T_NODE_EXTENDED.get(db, id)?.unwrap_or_default(); let udata = T_USER_NODE - .get(&db, &(session.user.name.as_str(), id))? + .get(db, &(session.user.name.as_str(), id))? .unwrap_or_default(); if *aj { @@ -80,7 +80,7 @@ pub async fn r_library_node_filter<'a>( let mut children = node .children .iter() - .map(|c| Ok(db.get_node_with_userdata(c, &session)?)) + .map(|c| db.get_node_with_userdata(c, &session)) .collect::<anyhow::Result<Vec<_>>>()? .into_iter() .collect(); @@ -113,7 +113,7 @@ pub async fn r_library_node_filter<'a>( Ok(Either::Left(LayoutPage { title: node.title.clone().unwrap_or_default(), content: markup::new! { - @NodePage { node: &node, id: &id, udata: &udata, children: &children, path: &path, filter: &filter, node_ext: &node_ext } + @NodePage { node: &node, id, udata: &udata, children: &children, path: &path, filter: &filter, node_ext: &node_ext } }, ..Default::default() })) @@ -220,10 +220,10 @@ markup::define! { } .title { @pe.person.name br; - @if let Some(c) = pe.characters.get(0) { + @if let Some(c) = pe.characters.first() { .subtitle { @c } } - @if let Some(c) = pe.jobs.get(0) { + @if let Some(c) = pe.jobs.first() { .subtitle { @c } } } @@ -359,11 +359,8 @@ impl MediaInfoExt for MediaInfo { fn resolution_name(&self) -> &'static str { let mut maxdim = 0; for t in &self.tracks { - match &t.kind { - SourceTrackKind::Video { width, height, .. } => { - maxdim = maxdim.max(*width.max(height)) - } - _ => (), + if let SourceTrackKind::Video { width, height, .. } = &t.kind { + maxdim = maxdim.max(*width.max(height)) } } |