lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README | LICENSE

commit 52abe09ac2fcce8910e5133c15b17cd28de32803
parent 63708da24f6f5216803f680d330c1691cba8173d
Author: triesap <tyson@radroots.org>
Date:   Sun, 15 Feb 2026 17:51:01 +0000

events: apply cargo fmt

Diffstat:
Mevents/src/account.rs | 2+-
Mevents/src/kinds.rs | 10++++++++--
Mevents/src/lib.rs | 20++++++++++----------
Mevents/src/listing.rs | 43+++++++++++++++++--------------------------
Mevents/src/message_file.rs | 7+++++--
Mevents/src/plot.rs | 5++++-
6 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/events/src/account.rs b/events/src/account.rs @@ -1,4 +1,4 @@ -use crate::{kinds::KIND_ACCOUNT_CLAIM as KIND_ACCOUNT_CLAIM_EVENT, RadrootsNostrEvent}; +use crate::{RadrootsNostrEvent, kinds::KIND_ACCOUNT_CLAIM as KIND_ACCOUNT_CLAIM_EVENT}; #[cfg(feature = "ts-rs")] use ts_rs::TS; diff --git a/events/src/kinds.rs b/events/src/kinds.rs @@ -167,11 +167,17 @@ mod kinds_constants_tests { ("KIND_LIST_SET_KIND_MUTE", KIND_LIST_SET_KIND_MUTE), ("KIND_LIST_SET_INTEREST", KIND_LIST_SET_INTEREST), ("KIND_LIST_SET_EMOJI", KIND_LIST_SET_EMOJI), - ("KIND_LIST_SET_RELEASE_ARTIFACT", KIND_LIST_SET_RELEASE_ARTIFACT), + ( + "KIND_LIST_SET_RELEASE_ARTIFACT", + KIND_LIST_SET_RELEASE_ARTIFACT, + ), ("KIND_LIST_SET_APP_CURATION", KIND_LIST_SET_APP_CURATION), ("KIND_LIST_SET_CALENDAR", KIND_LIST_SET_CALENDAR), ("KIND_LIST_SET_STARTER_PACK", KIND_LIST_SET_STARTER_PACK), - ("KIND_LIST_SET_MEDIA_STARTER_PACK", KIND_LIST_SET_MEDIA_STARTER_PACK), + ( + "KIND_LIST_SET_MEDIA_STARTER_PACK", + KIND_LIST_SET_MEDIA_STARTER_PACK, + ), ("KIND_FARM", KIND_FARM), ("KIND_PLOT", KIND_PLOT), ("KIND_COOP", KIND_COOP), diff --git a/events/src/lib.rs b/events/src/lib.rs @@ -9,32 +9,32 @@ use ts_rs::TS; #[cfg(not(feature = "std"))] use alloc::{string::String, vec::Vec}; -pub mod comment; pub mod account; +pub mod app_data; +pub mod comment; +pub mod coop; +pub mod document; +pub mod farm; pub mod follow; -pub mod gift_wrap; pub mod geochat; +pub mod gift_wrap; pub mod job; pub mod job_feedback; pub mod job_request; pub mod job_result; pub mod kinds; -pub mod listing; -pub mod document; pub mod list; pub mod list_set; -pub mod app_data; -pub mod coop; -pub mod farm; -pub mod resource_area; -pub mod resource_cap; +pub mod listing; pub mod message; -pub mod plot; pub mod message_file; +pub mod plot; pub mod post; pub mod profile; pub mod reaction; pub mod relay_document; +pub mod resource_area; +pub mod resource_cap; pub mod seal; pub mod tags; diff --git a/events/src/listing.rs b/events/src/listing.rs @@ -36,7 +36,10 @@ pub struct RadrootsListingEventMetadata { #[cfg_attr(feature = "ts-rs", derive(TS))] #[cfg_attr(feature = "ts-rs", ts(export, export_to = "types.ts"))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "snake_case", tag = "kind", content = "amount"))] +#[cfg_attr( + feature = "serde", + serde(rename_all = "snake_case", tag = "kind", content = "amount") +)] #[derive(Clone, Debug)] pub enum RadrootsListingAvailability { Window { @@ -53,28 +56,30 @@ pub enum RadrootsListingAvailability { #[cfg_attr(feature = "ts-rs", derive(TS))] #[cfg_attr(feature = "ts-rs", ts(export, export_to = "types.ts"))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "snake_case", tag = "kind", content = "amount"))] +#[cfg_attr( + feature = "serde", + serde(rename_all = "snake_case", tag = "kind", content = "amount") +)] #[derive(Clone, Debug)] pub enum RadrootsListingStatus { Active, Sold, - Other { - value: String, - }, + Other { value: String }, } #[cfg_attr(feature = "ts-rs", derive(TS))] #[cfg_attr(feature = "ts-rs", ts(export, export_to = "types.ts"))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "snake_case", tag = "kind", content = "amount"))] +#[cfg_attr( + feature = "serde", + serde(rename_all = "snake_case", tag = "kind", content = "amount") +)] #[derive(Clone, Debug)] pub enum RadrootsListingDeliveryMethod { Pickup, LocalDelivery, Shipping, - Other { - method: String, - }, + Other { method: String }, } #[cfg_attr(feature = "ts-rs", derive(TS))] @@ -93,20 +98,14 @@ pub struct RadrootsListing { ts(optional, type = "RadrootsResourceAreaRef | null") )] pub resource_area: Option<RadrootsResourceAreaRef>, - #[cfg_attr( - feature = "ts-rs", - ts(optional, type = "RadrootsPlotRef | null") - )] + #[cfg_attr(feature = "ts-rs", ts(optional, type = "RadrootsPlotRef | null"))] pub plot: Option<RadrootsPlotRef>, #[cfg_attr( feature = "ts-rs", ts(optional, type = "RadrootsCoreDiscount[] | null") )] pub discounts: Option<Vec<RadrootsCoreDiscount>>, - #[cfg_attr( - feature = "ts-rs", - ts(optional, type = "RadrootsCoreDecimal | null") - )] + #[cfg_attr(feature = "ts-rs", ts(optional, type = "RadrootsCoreDecimal | null"))] pub inventory_available: Option<RadrootsCoreDecimal>, #[cfg_attr( feature = "ts-rs", @@ -171,15 +170,7 @@ pub struct RadrootsListingProduct { } pub const RADROOTS_LISTING_PRODUCT_TAG_KEYS: [&str; 9] = [ - "key", - "title", - "category", - "summary", - "process", - "lot", - "location", - "profile", - "year", + "key", "title", "category", "summary", "process", "lot", "location", "profile", "year", ]; #[cfg_attr(feature = "ts-rs", derive(TS))] diff --git a/events/src/message_file.rs b/events/src/message_file.rs @@ -1,7 +1,7 @@ #![forbid(unsafe_code)] -use crate::{RadrootsNostrEvent, RadrootsNostrEventPtr}; use crate::message::RadrootsMessageRecipient; +use crate::{RadrootsNostrEvent, RadrootsNostrEventPtr}; #[cfg(feature = "ts-rs")] use ts_rs::TS; @@ -49,7 +49,10 @@ pub struct RadrootsMessageFile { pub original_hash: Option<String>, #[cfg_attr(feature = "ts-rs", ts(optional, type = "number | null"))] pub size: Option<u64>, - #[cfg_attr(feature = "ts-rs", ts(optional, type = "RadrootsMessageFileDimensions | null"))] + #[cfg_attr( + feature = "ts-rs", + ts(optional, type = "RadrootsMessageFileDimensions | null") + )] pub dimensions: Option<RadrootsMessageFileDimensions>, #[cfg_attr(feature = "ts-rs", ts(optional, type = "string | null"))] pub blurhash: Option<String>, diff --git a/events/src/plot.rs b/events/src/plot.rs @@ -1,4 +1,7 @@ -use crate::{RadrootsNostrEvent, farm::{RadrootsFarmRef, RadrootsGcsLocation}}; +use crate::{ + RadrootsNostrEvent, + farm::{RadrootsFarmRef, RadrootsGcsLocation}, +}; #[cfg(feature = "ts-rs")] use ts_rs::TS;