From cf2faa53bba0a6bbea3cf3d9cc6c233989ed09f7 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 24 Dec 2024 02:43:11 +0000 Subject: [PATCH] avoid obsolete `singlejpeg` ffmpeg format; appease clippy --- server/src/auth.rs | 6 +++--- server/src/lib.rs | 8 ++++---- server/src/media.rs | 7 +++---- server/src/tags.rs | 2 +- shared/src/tag_expression.rs | 4 ++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/server/src/auth.rs b/server/src/auth.rs index fe4a491..20c2274 100644 --- a/server/src/auth.rs +++ b/server/src/auth.rs @@ -35,7 +35,7 @@ pub fn hash_password(salt: &[u8], secret: &[u8]) -> String { &mut hash, ); - base64::encode(&hash) + base64::encode(hash) } /// Attempt to authenticate a user based on the credentials specified in `request`. @@ -47,8 +47,8 @@ pub fn hash_password(salt: &[u8], secret: &[u8]) -> String { /// * `mutex`: used to bottleneck all calls to this method in order to mitigate parallel brute force attacks /// /// * `invalid_credential_delay`: minimum delay added to responses to invalid authentication requests. Note that -/// these delays will stack up if invalid requests are received more often than once per this interval, so the -/// actual delay experienced by a given request may be much longer. +/// these delays will stack up if invalid requests are received more often than once per this interval, so the +/// actual delay experienced by a given request may be much longer. pub async fn authenticate( conn: &AsyncMutex, request: &TokenRequest, diff --git a/server/src/lib.rs b/server/src/lib.rs index d1d6600..32c94a9 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -261,7 +261,7 @@ fn response() -> response::Builder { /// * `conn`: used to access the Tagger database /// /// * `image_locks`: used to control concurrent access to the cache directory, e.g. to avoid simultaneous reads and -/// writes to cache files +/// writes to cache files /// /// * `options`: server configuration -- see [Options] for details /// @@ -937,7 +937,7 @@ mod test { let response = warp::test::request() .method("POST") .path("/token") - .body(&format!( + .body(format!( "grant_type=password&username={user}&password=invalid+password" )) .reply(&routes) @@ -952,7 +952,7 @@ mod test { let response = warp::test::request() .method("POST") .path("/token") - .body(&format!( + .body(format!( "grant_type=password&username={user}&password={password}" )) .reply(&routes) @@ -2830,7 +2830,7 @@ mod test { .arg("-frames:v") .arg("1") .arg("-f") - .arg("singlejpeg") + .arg("mjpeg") .arg("-") .output() .await?; diff --git a/server/src/media.rs b/server/src/media.rs index d6bd5de..ce703ba 100644 --- a/server/src/media.rs +++ b/server/src/media.rs @@ -203,7 +203,7 @@ async fn still_image(image_dir: &str, path: &str) -> Result<(Vec, ImageForma .arg("-frames:v") .arg("1") .arg("-f") - .arg("singlejpeg") + .arg("mjpeg") .arg("-") .output() .await?; @@ -331,7 +331,7 @@ pub fn group_similar<'a>(similar: HashMap<&'a Item, HashSet<&'a Item>>) -> Vec