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 --- transcoder/src/fragment.rs | 8 ++++---- transcoder/src/image.rs | 4 ++-- transcoder/src/thumbnail.rs | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'transcoder') diff --git a/transcoder/src/fragment.rs b/transcoder/src/fragment.rs index 7695a48..ecb73d5 100644 --- a/transcoder/src/fragment.rs +++ b/transcoder/src/fragment.rs @@ -22,7 +22,7 @@ pub async fn transcode( enc: &EncodingProfile, input: impl FnOnce(ChildStdin), ) -> anyhow::Result { - Ok(async_cache_file( + async_cache_file( &["frag-tc", key, &format!("{enc:?}")], move |mut output| async move { let _permit = LOCAL_VIDEO_TRANSCODING_TASKS.acquire().await?; @@ -78,9 +78,9 @@ pub async fn transcode( let mut proc = Command::new("ffmpeg") .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .args(&["-f", "matroska", "-i", "pipe:0"]) + .args(["-f", "matroska", "-i", "pipe:0"]) .args(args) - .args(&["-f", "webm", "pipe:1"]) + .args(["-f", "webm", "pipe:1"]) .spawn()?; // let mut proc = Command::new("cat") // .stdin(Stdio::piped()) @@ -98,5 +98,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/image.rs b/transcoder/src/image.rs index 3589ab9..3d7cb2d 100644 --- a/transcoder/src/image.rs +++ b/transcoder/src/image.rs @@ -22,7 +22,7 @@ pub async fn transcode( speed: u8, width: usize, ) -> anyhow::Result { - Ok(async_cache_file( + async_cache_file( &[ "image-tc", path.clone().as_os_str().to_str().unwrap(), @@ -96,5 +96,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/thumbnail.rs b/transcoder/src/thumbnail.rs index 9661fd0..c8bfb1c 100644 --- a/transcoder/src/thumbnail.rs +++ b/transcoder/src/thumbnail.rs @@ -5,7 +5,7 @@ use std::{path::Path, process::Stdio}; use tokio::{io::copy, process::Command}; pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result { - Ok(async_cache_file( + async_cache_file( &["thumb", path.to_str().unwrap(), &format!("{time}")], move |mut output| async move { let _permit = LOCAL_IMAGE_TRANSCODING_TASKS.acquire().await?; @@ -13,12 +13,12 @@ pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result anyhow::Result