From 34a47e6e5a7218e95f8bc4a4292eeee3438ff060 Mon Sep 17 00:00:00 2001 From: nelind Date: Sat, 18 Jul 2026 01:46:40 +0200 Subject: [PATCH] chore: clean up Cargo.toml files with cargo-shear and remove default feature on lib crates --- Cargo.lock | 53 -------------------- Cargo.toml | 2 - crates/tranquil-api/Cargo.toml | 4 -- crates/tranquil-api/src/repo/record/utils.rs | 1 - crates/tranquil-api/src/verification.rs | 31 ------------ crates/tranquil-cache/Cargo.toml | 1 - crates/tranquil-comms/Cargo.toml | 1 - crates/tranquil-config/Cargo.toml | 1 - crates/tranquil-db/Cargo.toml | 2 - crates/tranquil-infra/Cargo.toml | 2 - crates/tranquil-lexicon/Cargo.toml | 1 - crates/tranquil-pds/Cargo.toml | 21 +++----- crates/tranquil-pds/src/storage/mod.rs | 2 +- crates/tranquil-pds/tests/common/mod.rs | 16 +++--- crates/tranquil-server/Cargo.toml | 3 +- crates/tranquil-signal/Cargo.toml | 2 - crates/tranquil-storage/Cargo.toml | 1 - crates/tranquil-store/Cargo.toml | 3 +- crates/tranquil-types/Cargo.toml | 6 +-- crates/tranquil-types/src/lib.rs | 36 ++++++------- 20 files changed, 35 insertions(+), 154 deletions(-) delete mode 100644 crates/tranquil-api/src/repo/record/utils.rs delete mode 100644 crates/tranquil-api/src/verification.rs diff --git a/Cargo.lock b/Cargo.lock index 922a0fe..5805fa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2486,7 +2486,6 @@ checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", - "zlib-rs", ] [[package]] @@ -7632,7 +7631,6 @@ dependencies = [ name = "tranquil-api" version = "0.6.5" dependencies = [ - "anyhow", "axum", "backon", "base32", @@ -7666,17 +7664,14 @@ dependencies = [ "tokio", "tracing", "tranquil-config", - "tranquil-db", "tranquil-db-traits", "tranquil-lexicon", "tranquil-pds", - "tranquil-scopes", "tranquil-signal", "tranquil-types", "urlencoding", "uuid", "webauthn-rs", - "zip", ] [[package]] @@ -7734,7 +7729,6 @@ dependencies = [ "rsa", "secrecy", "serde_json", - "sqlx", "thiserror 2.0.18", "tokio", "tracing", @@ -7749,7 +7743,6 @@ name = "tranquil-config" version = "0.6.5" dependencies = [ "confique", - "serde", ] [[package]] @@ -7809,7 +7802,6 @@ dependencies = [ "bytes", "futures", "thiserror 2.0.18", - "tranquil-config", ] [[package]] @@ -7904,7 +7896,6 @@ dependencies = [ "base32", "base64 0.22.1", "bcrypt", - "bs58", "bytes", "chrono", "ciborium", @@ -7920,7 +7911,6 @@ dependencies = [ "hmac", "http 1.4.0", "image", - "infer", "ipld-core", "iroh-car", "jacquard-common", @@ -7962,7 +7952,6 @@ dependencies = [ "tranquil-cache", "tranquil-comms", "tranquil-config", - "tranquil-crypto", "tranquil-db", "tranquil-db-traits", "tranquil-lexicon", @@ -7981,7 +7970,6 @@ dependencies = [ "webauthn-rs", "webauthn-rs-proto", "wiremock", - "zip", ] [[package]] @@ -8089,7 +8077,6 @@ dependencies = [ "futures", "presage", "rand 0.9.2", - "serde", "serde_json", "sqlx", "tempfile", @@ -8097,7 +8084,6 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "tranquil-signal", "url", "uuid", ] @@ -8161,7 +8147,6 @@ dependencies = [ "tranquil-db", "tranquil-db-traits", "tranquil-oauth", - "tranquil-repo", "tranquil-store", "tranquil-types", "uuid", @@ -8255,12 +8240,6 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" -[[package]] -name = "typed-path" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e" - [[package]] name = "typenum" version = "1.19.0" @@ -9462,20 +9441,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "zip" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e33efc22a0650c311c2ef19115ce232583abbe80850bc8b66509ebef02de0" -dependencies = [ - "crc32fast", - "flate2", - "indexmap 2.13.0", - "memchr", - "typed-path", - "zopfli", -] - [[package]] name = "zkcredential" version = "0.1.0" @@ -9524,30 +9489,12 @@ dependencies = [ "zkcredential", ] -[[package]] -name = "zlib-rs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" - [[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" -[[package]] -name = "zopfli" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] - [[package]] name = "zune-core" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 6fa2a0c..4aac8c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,6 @@ tranquil-db = { path = "crates/tranquil-db" } tranquil-ripple = { path = "crates/tranquil-ripple" } tranquil-lexicon = { path = "crates/tranquil-lexicon" } tranquil-pds = { path = "crates/tranquil-pds" } -tranquil-server = { path = "crates/tranquil-server" } tranquil-sync = { path = "crates/tranquil-sync" } tranquil-oauth-server = { path = "crates/tranquil-oauth-server" } tranquil-api = { path = "crates/tranquil-api" } @@ -142,7 +141,6 @@ uuid = { version = "1.19", features = ["v4", "v5", "v7", "fast-rng", "serde"] } webauthn-rs = { version = "0.5", features = ["danger-allow-state-serialisation", "danger-user-presence-only-security-keys", "conditional-ui"] } webauthn-rs-proto = "0.5" x509-parser = "0.18" -zip = { version = "7.0", default-features = false, features = ["deflate"] } ciborium = "0.2" ctor = "0.6" diff --git a/crates/tranquil-api/Cargo.toml b/crates/tranquil-api/Cargo.toml index 6d9d513..5459a0f 100644 --- a/crates/tranquil-api/Cargo.toml +++ b/crates/tranquil-api/Cargo.toml @@ -8,13 +8,10 @@ license.workspace = true tranquil-pds = { workspace = true } tranquil-types = { workspace = true } tranquil-config = { workspace = true } -tranquil-db = { workspace = true } tranquil-db-traits = { workspace = true } tranquil-lexicon = { workspace = true, features = ["resolve"] } -tranquil-scopes = { workspace = true } tranquil-signal = { workspace = true } -anyhow = { workspace = true } axum = { workspace = true } backon = { workspace = true } base32 = { workspace = true } @@ -50,4 +47,3 @@ tracing = { workspace = true } urlencoding = { workspace = true } uuid = { workspace = true } webauthn-rs = { workspace = true } -zip = { workspace = true } diff --git a/crates/tranquil-api/src/repo/record/utils.rs b/crates/tranquil-api/src/repo/record/utils.rs deleted file mode 100644 index 44088b7..0000000 --- a/crates/tranquil-api/src/repo/record/utils.rs +++ /dev/null @@ -1 +0,0 @@ -pub use tranquil_pds::repo_ops::*; diff --git a/crates/tranquil-api/src/verification.rs b/crates/tranquil-api/src/verification.rs deleted file mode 100644 index 8a396e6..0000000 --- a/crates/tranquil-api/src/verification.rs +++ /dev/null @@ -1,31 +0,0 @@ -use axum::{ - Json, - extract::State, - response::{IntoResponse, Response}, -}; -use serde::Deserialize; -use tranquil_pds::api::SuccessResponse; -use tranquil_pds::state::AppState; - -#[derive(Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ConfirmChannelVerificationInput { - pub channel: tranquil_db_traits::CommsChannel, - pub identifier: String, - pub code: String, -} - -pub async fn confirm_channel_verification( - State(state): State, - Json(input): Json, -) -> Response { - let token_input = crate::server::VerifyTokenInput { - token: input.code, - identifier: input.identifier, - }; - - match crate::server::verify_token_internal(&state, token_input).await { - Ok(_output) => SuccessResponse::ok().into_response(), - Err(e) => e.into_response(), - } -} diff --git a/crates/tranquil-cache/Cargo.toml b/crates/tranquil-cache/Cargo.toml index e06e3b2..de971ff 100644 --- a/crates/tranquil-cache/Cargo.toml +++ b/crates/tranquil-cache/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true license.workspace = true [features] -default = [] valkey = ["dep:redis"] [dependencies] diff --git a/crates/tranquil-comms/Cargo.toml b/crates/tranquil-comms/Cargo.toml index 1a6ae7b..984b117 100644 --- a/crates/tranquil-comms/Cargo.toml +++ b/crates/tranquil-comms/Cargo.toml @@ -19,7 +19,6 @@ reqwest = { workspace = true } rsa = { workspace = true } secrecy = { workspace = true } serde_json = { workspace = true } -sqlx = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } diff --git a/crates/tranquil-config/Cargo.toml b/crates/tranquil-config/Cargo.toml index a5973c7..468044d 100644 --- a/crates/tranquil-config/Cargo.toml +++ b/crates/tranquil-config/Cargo.toml @@ -6,4 +6,3 @@ license.workspace = true [dependencies] confique = { workspace = true } -serde = { workspace = true } diff --git a/crates/tranquil-db/Cargo.toml b/crates/tranquil-db/Cargo.toml index dd34454..e468eb3 100644 --- a/crates/tranquil-db/Cargo.toml +++ b/crates/tranquil-db/Cargo.toml @@ -5,9 +5,7 @@ edition.workspace = true license.workspace = true [features] -default = ["postgres"] postgres = [] -sqlite = [] [dependencies] tranquil-db-traits = { workspace = true } diff --git a/crates/tranquil-infra/Cargo.toml b/crates/tranquil-infra/Cargo.toml index ac01504..4c7436e 100644 --- a/crates/tranquil-infra/Cargo.toml +++ b/crates/tranquil-infra/Cargo.toml @@ -5,8 +5,6 @@ edition.workspace = true license.workspace = true [dependencies] -tranquil-config = { workspace = true } - async-trait = { workspace = true } bytes = { workspace = true } futures = { workspace = true } diff --git a/crates/tranquil-lexicon/Cargo.toml b/crates/tranquil-lexicon/Cargo.toml index 1dbfa28..99e7eb0 100644 --- a/crates/tranquil-lexicon/Cargo.toml +++ b/crates/tranquil-lexicon/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true license.workspace = true [features] -default = [] resolve = ["dep:reqwest", "dep:hickory-resolver", "dep:tokio", "dep:parking_lot", "dep:tracing", "dep:urlencoding"] [dependencies] diff --git a/crates/tranquil-pds/Cargo.toml b/crates/tranquil-pds/Cargo.toml index 12a7550..75b6a96 100644 --- a/crates/tranquil-pds/Cargo.toml +++ b/crates/tranquil-pds/Cargo.toml @@ -7,7 +7,6 @@ license.workspace = true [dependencies] tranquil-types = { workspace = true } tranquil-config = { workspace = true } -tranquil-crypto = { workspace = true } tranquil-storage = { workspace = true } tranquil-cache = { workspace = true } tranquil-repo = { workspace = true } @@ -29,13 +28,11 @@ axum = { workspace = true } base32 = { workspace = true } base64 = { workspace = true } bcrypt = { workspace = true } -bs58 = { workspace = true } bytes = { workspace = true } chrono = { workspace = true } cid = { workspace = true } ed25519-dalek = { workspace = true } futures = { workspace = true } -hex = { workspace = true } futures-util = { workspace = true } governor = { workspace = true } hickory-resolver = { workspace = true } @@ -43,7 +40,6 @@ hkdf = { workspace = true } hmac = { workspace = true } http = { workspace = true } image = { workspace = true } -infer = { workspace = true } ipld-core = { workspace = true } iroh-car = { workspace = true } jacquard-common = { workspace = true } @@ -57,7 +53,6 @@ multihash = { workspace = true } p256 = { workspace = true } parking_lot = { workspace = true } rand = { workspace = true } -redis = { workspace = true, optional = true } regex = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } @@ -70,7 +65,6 @@ sqlx = { workspace = true } subtle = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } -tokio-tungstenite = { workspace = true } tokio-util = { workspace = true } tower = { workspace = true } tower-http = { workspace = true } @@ -80,16 +74,12 @@ urlencoding = { workspace = true } uuid = { workspace = true } webauthn-rs = { workspace = true } webauthn-rs-proto = { workspace = true } -zip = { workspace = true } -aws-config = { workspace = true, optional = true } -aws-sdk-s3 = { workspace = true, optional = true } [features] -default = ["frontend", "s3", "valkey"] external-infra = [] -s3-storage = ["tranquil-storage/s3", "dep:aws-config", "dep:aws-sdk-s3"] -s3 = ["s3-storage"] -valkey = ["tranquil-cache/valkey", "dep:redis"] +postgres = ["tranquil-db/postgres"] +s3 = ["tranquil-storage/s3"] +valkey = ["tranquil-cache/valkey"] frontend = [] native-tls-roots = ["tranquil-oauth/native-tls-roots"] @@ -105,3 +95,8 @@ tranquil-api = { workspace = true } tranquil-oauth-server = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } wiremock = { workspace = true } +hex = { workspace = true } +tokio-tungstenite = { workspace = true } +aws-config = { workspace = true } +aws-sdk-s3 = { workspace = true } +redis = { workspace = true } diff --git a/crates/tranquil-pds/src/storage/mod.rs b/crates/tranquil-pds/src/storage/mod.rs index 58e25d9..c105761 100644 --- a/crates/tranquil-pds/src/storage/mod.rs +++ b/crates/tranquil-pds/src/storage/mod.rs @@ -2,5 +2,5 @@ pub use tranquil_storage::{ BlobStorage, FilesystemBlobStorage, StorageError, StreamUploadResult, create_blob_storage, }; -#[cfg(feature = "s3-storage")] +#[cfg(feature = "s3")] pub use tranquil_storage::S3BlobStorage; diff --git a/crates/tranquil-pds/tests/common/mod.rs b/crates/tranquil-pds/tests/common/mod.rs index 813e359..3c82d3a 100644 --- a/crates/tranquil-pds/tests/common/mod.rs +++ b/crates/tranquil-pds/tests/common/mod.rs @@ -1,8 +1,8 @@ -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] use aws_config::BehaviorVersion; -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] use aws_sdk_s3::Client as S3Client; -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] use aws_sdk_s3::config::Credentials; use chrono::Utc; use reqwest::{Client, StatusCode, header}; @@ -56,9 +56,9 @@ pub struct ServerInstance { pub distributed_rate_limiter: Option>, } -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] use testcontainers::GenericImage; -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] use testcontainers::core::ContainerPort; #[cfg(not(feature = "external-infra"))] use testcontainers::{ContainerAsync, ImageExt, runners::AsyncRunner}; @@ -66,7 +66,7 @@ use testcontainers::{ContainerAsync, ImageExt, runners::AsyncRunner}; use testcontainers_modules::postgres::Postgres; #[cfg(not(feature = "external-infra"))] static DB_CONTAINER: OnceLock> = OnceLock::new(); -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] static S3_CONTAINER: OnceLock> = OnceLock::new(); #[allow(dead_code)] @@ -195,7 +195,7 @@ async fn setup_with_external_infra() -> String { spawn_app(database_url).await } -#[cfg(all(not(feature = "external-infra"), not(feature = "s3-storage")))] +#[cfg(all(not(feature = "external-infra"), not(feature = "s3")))] async fn setup_with_testcontainers() -> String { let temp_dir = std::env::temp_dir().join(format!("tranquil-pds-test-{}", uuid::Uuid::new_v4())); let blob_path = temp_dir.join("blobs"); @@ -227,7 +227,7 @@ async fn setup_with_testcontainers() -> String { spawn_app(connection_string).await } -#[cfg(all(not(feature = "external-infra"), feature = "s3-storage"))] +#[cfg(all(not(feature = "external-infra"), feature = "s3"))] async fn setup_with_testcontainers() -> String { let s3_container = GenericImage::new("cgr.dev/chainguard/minio", "latest") .with_exposed_port(ContainerPort::Tcp(9000)) diff --git a/crates/tranquil-server/Cargo.toml b/crates/tranquil-server/Cargo.toml index f31f0df..4e1d7ae 100644 --- a/crates/tranquil-server/Cargo.toml +++ b/crates/tranquil-server/Cargo.toml @@ -41,8 +41,9 @@ tracing-subscriber = { workspace = true } rcgen = { workspace = true } [features] -default = ["frontend", "s3", "valkey"] +default = ["frontend", "postgres", "s3", "valkey"] frontend = ["tranquil-pds/frontend"] +postgres = ["tranquil-pds/postgres"] s3 = ["tranquil-pds/s3"] valkey = ["tranquil-pds/valkey"] native-tls-roots = ["tranquil-pds/native-tls-roots"] diff --git a/crates/tranquil-signal/Cargo.toml b/crates/tranquil-signal/Cargo.toml index 1a12ad9..ed8d49a 100644 --- a/crates/tranquil-signal/Cargo.toml +++ b/crates/tranquil-signal/Cargo.toml @@ -17,13 +17,11 @@ tracing = { workspace = true } tokio = { workspace = true } tokio-util = { workspace = true } futures = { workspace = true } -serde = { workspace = true } serde_json = { workspace = true } url = "2.5" uuid = { workspace = true } thiserror = { workspace = true } [dev-dependencies] -tranquil-signal = { path = ".", features = ["fjall-store"] } rand = "0.9" tempfile = "3" diff --git a/crates/tranquil-storage/Cargo.toml b/crates/tranquil-storage/Cargo.toml index 77d256f..fc03d73 100644 --- a/crates/tranquil-storage/Cargo.toml +++ b/crates/tranquil-storage/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true license.workspace = true [features] -default = [] s3 = ["dep:aws-config", "dep:aws-sdk-s3"] [dependencies] diff --git a/crates/tranquil-store/Cargo.toml b/crates/tranquil-store/Cargo.toml index cfbc81c..fcca210 100644 --- a/crates/tranquil-store/Cargo.toml +++ b/crates/tranquil-store/Cargo.toml @@ -59,8 +59,7 @@ tempfile = "3" futures = { workspace = true } tokio = { workspace = true, features = ["sync", "rt-multi-thread", "macros", "time"] } jacquard-common = { workspace = true } -tranquil-repo = { workspace = true } -tranquil-db = { workspace = true } +tranquil-db = { workspace = true, features = [ "postgres" ] } sqlx = { workspace = true } k256 = { workspace = true } rand = { workspace = true } diff --git a/crates/tranquil-types/Cargo.toml b/crates/tranquil-types/Cargo.toml index 27bd898..4055d2b 100644 --- a/crates/tranquil-types/Cargo.toml +++ b/crates/tranquil-types/Cargo.toml @@ -4,10 +4,6 @@ version.workspace = true edition.workspace = true license.workspace = true -[features] -default = ["sqlx"] -sqlx = ["dep:sqlx"] - [dependencies] base64 = { workspace = true } chrono = { workspace = true } @@ -16,6 +12,6 @@ jacquard-common = { workspace = true } rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -sqlx = { workspace = true, optional = true } +sqlx = { workspace = true } thiserror = { workspace = true } uuid = { workspace = true } diff --git a/crates/tranquil-types/src/lib.rs b/crates/tranquil-types/src/lib.rs index f1140eb..039fdcd 100644 --- a/crates/tranquil-types/src/lib.rs +++ b/crates/tranquil-types/src/lib.rs @@ -92,9 +92,9 @@ macro_rules! simple_string_newtype { $vis:vis struct $name:ident; ) => { $(#[$meta])* - #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] - #[cfg_attr(feature = "sqlx", derive(sqlx::Type), sqlx(transparent))] + #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, sqlx::Type)] #[serde(transparent)] + #[sqlx(transparent)] $vis struct $name(String); impl $name { @@ -148,9 +148,9 @@ macro_rules! validated_string_newtype { validator = $validator:expr; ) => { $(#[$meta])* - #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] - #[cfg_attr(feature = "sqlx", derive(sqlx::Type), sqlx(transparent))] + #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, sqlx::Type)] #[serde(transparent)] + #[sqlx(transparent)] $vis struct $name(String); impl<'de> Deserialize<'de> for $name { @@ -223,9 +223,9 @@ impl Did { } } -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] -#[cfg_attr(feature = "sqlx", derive(sqlx::Type), sqlx(transparent))] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, sqlx::Type)] #[serde(transparent)] +#[sqlx(transparent)] pub struct Handle(String); impl<'de> Deserialize<'de> for Handle { @@ -523,9 +523,9 @@ validated_string_newtype! { validator = |s| jacquard_common::types::string::Language::from_str(s).map(|v| v.as_str().to_owned()).map_err(|_| ()); } -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] -#[cfg_attr(feature = "sqlx", derive(sqlx::Type), sqlx(transparent))] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, sqlx::Type)] #[serde(transparent)] +#[sqlx(transparent)] pub struct CidLink(String); impl<'de> Deserialize<'de> for CidLink { @@ -718,9 +718,9 @@ impl Deref for PlainPassword { } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[cfg_attr(feature = "sqlx", derive(sqlx::Type), sqlx(transparent))] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, sqlx::Type)] #[serde(transparent)] +#[sqlx(transparent)] pub struct PasswordHash(String); impl PasswordHash { @@ -843,13 +843,9 @@ simple_string_newtype! { pub struct InviteCode; } -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[cfg_attr( - feature = "sqlx", - derive(sqlx::Type), - sqlx(type_name = "comms_channel", rename_all = "snake_case") -)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, sqlx::Type)] #[serde(rename_all = "snake_case")] +#[sqlx(type_name = "comms_channel", rename_all = "snake_case")] #[derive(Copy)] pub enum CommsChannel { Email, @@ -885,13 +881,9 @@ impl fmt::Display for CommsChannel { } } -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[cfg_attr( - feature = "sqlx", - derive(sqlx::Type), - sqlx(type_name = "comms_type", rename_all = "snake_case") -)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, sqlx::Type)] #[serde(rename_all = "snake_case")] +#[sqlx(type_name = "comms_type", rename_all = "snake_case")] pub enum CommsType { Verification, PasswordReset,