From 53a89a51d3f67f6f355f1925cad3ebca8c04e00d Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 11 Nov 2024 23:05:23 +0100 Subject: [PATCH] clippy --- src/backend/api/article.rs | 5 ----- src/common/mod.rs | 7 +++---- src/lib.rs | 3 --- tests/test.rs | 2 -- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/backend/api/article.rs b/src/backend/api/article.rs index 45265c6..cc7fa03 100644 --- a/src/backend/api/article.rs +++ b/src/backend/api/article.rs @@ -116,12 +116,7 @@ pub(in crate::backend::api) async fn edit_article( edit_form.new_text.push('\n'); } - dbg!( - &edit_form.previous_version_id, - &original_article.latest_version - ); if edit_form.previous_version_id == original_article.latest_version { - dbg!("no conflict"); // No intermediate changes, simply submit new version submit_article_update( edit_form.new_text.clone(), diff --git a/src/common/mod.rs b/src/common/mod.rs index 4734e2b..9f61d8d 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -15,6 +15,7 @@ use { }, activitypub_federation::fetch::{collection_id::CollectionId, object_id::ObjectId}, diesel::{Identifiable, Queryable, Selectable}, + diesel_derive_newtype::DieselNewType, }; pub const MAIN_PAGE_NAME: &str = "Main_Page"; @@ -149,10 +150,8 @@ pub struct DbLocalUser { pub person_id: i32, pub admin: bool, } - -#[derive( - Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize, DieselNewType, -)] +#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "ssr", derive(DieselNewType))] pub struct PersonId(pub i32); /// Federation related data from a local or remote user. diff --git a/src/lib.rs b/src/lib.rs index 0edc1ce..d24c3dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,3 @@ -#[macro_use] -extern crate diesel_derive_newtype; - #[cfg(feature = "ssr")] pub mod backend; pub mod common; diff --git a/tests/test.rs b/tests/test.rs index f9f3368..adacdf3 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -358,7 +358,6 @@ async fn test_local_edit_conflict() -> MyResult<()> { previous_version_id: create_res.latest_version.clone(), resolve_conflict_id: None, }; - dbg!("first edit"); let edit_res = data.alpha.edit_article(&edit_form).await?; assert_eq!(edit_res.article.text, edit_form.new_text); assert_eq!(2, edit_res.edits.len()); @@ -371,7 +370,6 @@ async fn test_local_edit_conflict() -> MyResult<()> { previous_version_id: create_res.latest_version, resolve_conflict_id: None, }; - dbg!("second edit"); let edit_res = data .alpha .edit_article_with_conflict(&edit_form)