From d1b33ad76fa72a6f77bde9aed523aedb61a5b4e4 Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 11 May 2024 04:31:59 +0900 Subject: [PATCH] chore (backend-rs): move acct to another directory --- packages/backend-rs/src/{misc => federation}/acct.rs | 6 ++++++ packages/backend-rs/src/federation/mod.rs | 1 + packages/backend-rs/src/lib.rs | 1 + packages/backend-rs/src/misc/mod.rs | 1 - 4 files changed, 8 insertions(+), 1 deletion(-) rename packages/backend-rs/src/{misc => federation}/acct.rs (96%) create mode 100644 packages/backend-rs/src/federation/mod.rs diff --git a/packages/backend-rs/src/misc/acct.rs b/packages/backend-rs/src/federation/acct.rs similarity index 96% rename from packages/backend-rs/src/misc/acct.rs rename to packages/backend-rs/src/federation/acct.rs index 7a3c2f8ada..f9564ea61b 100644 --- a/packages/backend-rs/src/misc/acct.rs +++ b/packages/backend-rs/src/federation/acct.rs @@ -42,6 +42,12 @@ impl fmt::Display for Acct { } } +impl Into for Acct { + fn into(self) -> String { + self.to_string() + } +} + #[crate::ts_only_warn("Use `acct.parse().unwrap()` or `Acct::from_str(acct).unwrap()` instead.")] #[crate::export] pub fn string_to_acct(acct: &str) -> Acct { diff --git a/packages/backend-rs/src/federation/mod.rs b/packages/backend-rs/src/federation/mod.rs new file mode 100644 index 0000000000..93a92c008b --- /dev/null +++ b/packages/backend-rs/src/federation/mod.rs @@ -0,0 +1 @@ +pub mod acct; diff --git a/packages/backend-rs/src/lib.rs b/packages/backend-rs/src/lib.rs index f4d9b431f9..2a7f60111e 100644 --- a/packages/backend-rs/src/lib.rs +++ b/packages/backend-rs/src/lib.rs @@ -2,6 +2,7 @@ pub use macro_rs::{export, ts_only_warn}; pub mod config; pub mod database; +pub mod federation; pub mod misc; pub mod model; pub mod service; diff --git a/packages/backend-rs/src/misc/mod.rs b/packages/backend-rs/src/misc/mod.rs index d0575c1282..8b81ccde1c 100644 --- a/packages/backend-rs/src/misc/mod.rs +++ b/packages/backend-rs/src/misc/mod.rs @@ -1,4 +1,3 @@ -pub mod acct; pub mod add_note_to_antenna; pub mod check_server_block; pub mod check_word_mute;