From 2e44357665237c6d1aa70c3b9a011fe81d0de596 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 31 May 2024 21:28:53 +0900 Subject: [PATCH] chore (backend-rs): remove unneeded serde derives --- packages/backend-rs/src/federation/nodeinfo/fetch.rs | 6 +++--- packages/backend-rs/src/misc/get_note_summary.rs | 4 ++-- packages/backend-rs/src/misc/latest_version.rs | 4 ++-- packages/backend-rs/src/service/stream/custom_emoji.rs | 4 ++-- packages/backend-rs/src/service/stream/moderation.rs | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/backend-rs/src/federation/nodeinfo/fetch.rs b/packages/backend-rs/src/federation/nodeinfo/fetch.rs index 14ed838912..e762ba7138 100644 --- a/packages/backend-rs/src/federation/nodeinfo/fetch.rs +++ b/packages/backend-rs/src/federation/nodeinfo/fetch.rs @@ -3,7 +3,7 @@ use crate::federation::nodeinfo::schema::*; use crate::util::http_client; use isahc::AsyncReadResponseExt; -use serde::{Deserialize, Serialize}; +use serde::Deserialize; #[derive(thiserror::Error, Debug)] pub enum Error { @@ -21,12 +21,12 @@ pub enum Error { MissingNodeinfo, } -#[derive(Deserialize, Serialize, Debug)] +#[derive(Deserialize, Debug)] pub struct NodeinfoLinks { links: Vec, } -#[derive(Deserialize, Serialize, Debug)] +#[derive(Deserialize, Debug)] pub struct NodeinfoLink { rel: String, href: String, diff --git a/packages/backend-rs/src/misc/get_note_summary.rs b/packages/backend-rs/src/misc/get_note_summary.rs index 64a0b52da2..24d703a70f 100644 --- a/packages/backend-rs/src/misc/get_note_summary.rs +++ b/packages/backend-rs/src/misc/get_note_summary.rs @@ -1,7 +1,7 @@ -use serde::{Deserialize, Serialize}; +use serde::Deserialize; // TODO?: handle name collisions -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] #[crate::export(object, js_name = "NoteLikeForGetNoteSummary")] pub struct NoteLike { diff --git a/packages/backend-rs/src/misc/latest_version.rs b/packages/backend-rs/src/misc/latest_version.rs index 8c361aa5bf..7233814df6 100644 --- a/packages/backend-rs/src/misc/latest_version.rs +++ b/packages/backend-rs/src/misc/latest_version.rs @@ -3,7 +3,7 @@ use crate::database::cache; use crate::util::http_client; use isahc::ReadResponseExt; -use serde::{Deserialize, Serialize}; +use serde::Deserialize; #[derive(thiserror::Error, Debug)] pub enum Error { @@ -25,7 +25,7 @@ const UPSTREAM_PACKAGE_JSON_URL: &str = "https://firefish.dev/firefish/firefish/-/raw/main/package.json"; async fn get_latest_version() -> Result { - #[derive(Debug, Deserialize, Serialize)] + #[derive(Debug, Deserialize)] struct Response { version: String, } diff --git a/packages/backend-rs/src/service/stream/custom_emoji.rs b/packages/backend-rs/src/service/stream/custom_emoji.rs index 2cd67f5169..29b655b6e6 100644 --- a/packages/backend-rs/src/service/stream/custom_emoji.rs +++ b/packages/backend-rs/src/service/stream/custom_emoji.rs @@ -1,8 +1,8 @@ use crate::service::stream::{publish_to_stream, Error, Stream}; -use serde::{Deserialize, Serialize}; +use serde::Serialize; // TODO: define schema type in other place -#[derive(Deserialize, Serialize)] +#[derive(Serialize)] #[serde(rename_all = "camelCase")] #[crate::export(object)] pub struct PackedEmoji { diff --git a/packages/backend-rs/src/service/stream/moderation.rs b/packages/backend-rs/src/service/stream/moderation.rs index ef604ed6bf..e9e17d2399 100644 --- a/packages/backend-rs/src/service/stream/moderation.rs +++ b/packages/backend-rs/src/service/stream/moderation.rs @@ -1,7 +1,7 @@ use crate::service::stream::{publish_to_stream, Error, Stream}; -use serde::{Deserialize, Serialize}; +use serde::Serialize; -#[derive(Deserialize, Serialize)] +#[derive(Serialize)] #[serde(rename_all = "camelCase")] #[crate::export(object)] pub struct AbuseUserReportLike {