From ab500733aa1e9c272e1c3b1220e2cd2e59927ab3 Mon Sep 17 00:00:00 2001 From: Joseph LaFreniere Date: Mon, 19 Jun 2023 22:25:57 -0500 Subject: [PATCH] Run clippy --- src/adapters/ffmpeg.rs | 4 ++-- src/adapters/sqlite.rs | 2 +- src/preproc_cache.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapters/ffmpeg.rs b/src/adapters/ffmpeg.rs index b18b666..2ed3612 100644 --- a/src/adapters/ffmpeg.rs +++ b/src/adapters/ffmpeg.rs @@ -134,7 +134,7 @@ impl WritingFileAdapter for FFmpegAdapter { return Err(format_err!("ffprobe failed: {:?}", exit)); } } - if subtitle_streams.len() > 0 { + if !subtitle_streams.is_empty() { for probe_stream in subtitle_streams.iter() { // extract subtitles let mut cmd = Command::new("ffmpeg"); @@ -143,7 +143,7 @@ impl WritingFileAdapter for FFmpegAdapter { .arg("-i") .arg(&inp_fname) .arg("-map") - .arg(format!("0:{}", probe_stream.index.to_string())) // 0 for first input + .arg(format!("0:{}", probe_stream.index)) // 0 for first input .arg("-f") .arg("webvtt") .arg("-"); diff --git a/src/adapters/sqlite.rs b/src/adapters/sqlite.rs index 826d091..dba24a4 100644 --- a/src/adapters/sqlite.rs +++ b/src/adapters/sqlite.rs @@ -138,7 +138,7 @@ mod test { #[tokio::test] async fn simple() -> Result<()> { - let adapter: Box = Box::new(SqliteAdapter::default()); + let adapter: Box = Box::::default(); let fname = test_data_dir().join("hello.sqlite3"); let (a, d) = simple_fs_adapt_info(&fname).await?; let res = adapter.adapt(a, &d).await?; diff --git a/src/preproc_cache.rs b/src/preproc_cache.rs index f361792..d0eed0e 100644 --- a/src/preproc_cache.rs +++ b/src/preproc_cache.rs @@ -181,7 +181,7 @@ mod test { #[tokio::test] async fn test_read_write() -> anyhow::Result<()> { let path = tempfile::tempdir()?; - let db = open_cache_db(&path.path().join("foo.sqlite3")).await?; + let _db = open_cache_db(&path.path().join("foo.sqlite3")).await?; // db.set(); Ok(()) }