diff --git a/crates/api_common/Cargo.toml b/crates/api_common/Cargo.toml index 9d144ddb4..b54d8e48b 100644 --- a/crates/api_common/Cargo.toml +++ b/crates/api_common/Cargo.toml @@ -44,7 +44,7 @@ lemmy_db_views = { workspace = true } lemmy_db_views_moderator = { workspace = true } lemmy_db_views_actor = { workspace = true } lemmy_db_schema = { workspace = true } -lemmy_utils = { workspace = true, features = ["error-type"] } +lemmy_utils = { workspace = true } activitypub_federation = { workspace = true, optional = true } serde = { workspace = true } serde_with = { workspace = true } diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 326cbf2e4..1b9757ff8 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -23,7 +23,8 @@ workspace = true [features] default = [ - "error-type", + "dep:serde", + "dep:strum", "dep:serde_json", "dep:anyhow", "dep:tracing-error", @@ -53,7 +54,6 @@ default = [ ] full = ["default", "dep:ts-rs"] -error-type = ["dep:serde", "dep:strum"] [dependencies] regex = { workspace = true, optional = true } diff --git a/crates/utils/src/error.rs b/crates/utils/src/error.rs index 0f68d70da..645a288ff 100644 --- a/crates/utils/src/error.rs +++ b/crates/utils/src/error.rs @@ -6,8 +6,8 @@ use strum_macros::{Display, EnumIter}; use ts_rs::TS; #[derive(Display, Debug, Serialize, Deserialize, Clone, PartialEq, Eq, EnumIter, Hash)] -#[cfg_attr(feature = "ts-rs", derive(TS))] -#[cfg_attr(feature = "ts-rs", ts(export))] +#[cfg_attr(feature = "full", derive(TS))] +#[cfg_attr(feature = "full", ts(export))] #[serde(tag = "error", content = "message", rename_all = "snake_case")] #[non_exhaustive] // TODO: order these based on the crate they belong to (utils, federation, db, api) diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index 65dbaaa45..e1f350e15 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -12,17 +12,12 @@ cfg_if! { pub mod settings; pub mod utils; pub mod version; + pub use error::LemmyErrorType; } else { mod error; } } -cfg_if! { - if #[cfg(feature = "error-type")] { - pub use error::LemmyErrorType; - } -} - use std::time::Duration; pub type ConnectionId = usize; diff --git a/crates/utils/translations b/crates/utils/translations index c3e61706e..a36865ee8 160000 --- a/crates/utils/translations +++ b/crates/utils/translations @@ -1 +1 @@ -Subproject commit c3e61706e2ff7977db83e964e3010f72cad5e408 +Subproject commit a36865ee8ca3658fea31ba948b67b75a812e84fc