From fc925564cc2324b1343da721b1e8aab680292ac9 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 1 Jan 2025 05:57:47 +0300 Subject: Partially appease clippy Some false positives on `serde(rename)` remain, as well as lints still requiring my attention. Change-Id: I3166771af20b2d07c6226b3b1a9d15fe36152356 --- src/database/file/mod.rs | 1 + src/database/postgres/mod.rs | 1 - src/media/storage/mod.rs | 2 +- src/micropub/mod.rs | 8 ++------ 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index 5890f95..db9bb22 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -528,6 +528,7 @@ impl Storage for FileStorage { limit: usize, user: Option<&url::Url> ) -> Result)>> { + #[allow(deprecated)] Ok(self.read_feed_with_limit( url, cursor, diff --git a/src/database/postgres/mod.rs b/src/database/postgres/mod.rs index 2c2dacc..98d9f8d 100644 --- a/src/database/postgres/mod.rs +++ b/src/database/postgres/mod.rs @@ -3,7 +3,6 @@ use std::borrow::Cow; use futures::{Stream, StreamExt}; use kittybox_util::{micropub::Channel as MicropubChannel, MentionType}; use sqlx::{ConnectOptions, Executor, PgPool}; -use crate::micropub::{MicropubUpdate, MicropubPropertyDeletion}; use super::settings::Setting; use super::{Storage, Result, StorageError, ErrorKind}; diff --git a/src/media/storage/mod.rs b/src/media/storage/mod.rs index b6f6ad7..551b61e 100644 --- a/src/media/storage/mod.rs +++ b/src/media/storage/mod.rs @@ -174,7 +174,7 @@ pub trait MediaStore: 'static + Send + Sync + Clone { fn metadata(&self, domain: &str, filename: &str) -> impl Future> + Send { async move { self.read_streaming(domain, filename) .await - .map(|(meta, stream)| meta) + .map(|(meta, _)| meta) } } fn delete(&self, domain: &str, filename: &str) -> impl Future> + Send; diff --git a/src/micropub/mod.rs b/src/micropub/mod.rs index f5cb5b9..621d4f9 100644 --- a/src/micropub/mod.rs +++ b/src/micropub/mod.rs @@ -370,7 +370,7 @@ impl MicropubUpdate { } } if let Some(replace) = &self.replace { - if replace.iter().map(|(k, v)| k.as_str()).any(|k| { + if replace.iter().map(|(k, _)| k.as_str()).any(|k| { k.to_lowercase().as_str() == "uid" }) { return Err(MicropubError::from_static( @@ -671,11 +671,7 @@ pub(crate) async fn query( Some(url) => { match db.get_post(&url).await { Ok(some) => match some { - Some(post) => { - let mut response = axum::response::Json(&post).into_response(); - - response - }, + Some(post) => axum::response::Json(&post).into_response(), None => MicropubError::from_static( ErrorKind::NotFound, "The specified MF2 object was not found in database.", -- cgit 1.4.1