From ba4fd6d8e9ca18cc18e75d48ab8a3a0bebc7b4e4 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Fri, 30 May 2025 14:01:24 +0100 Subject: chore(stanza): update peanuts and use workspace deps --- jid/Cargo.toml | 2 +- jid/src/lib.rs | 60 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'jid') diff --git a/jid/Cargo.toml b/jid/Cargo.toml index b8f4956..58d59a4 100644 --- a/jid/Cargo.toml +++ b/jid/Cargo.toml @@ -10,7 +10,7 @@ serde = ["dep:serde"] # sqlx = ["dep:sqlx"] [dependencies] -serde = { version = "1.0.219", features = ["derive"], optional = true } +serde = { workspace = true, features = ["derive"], optional = true } rusqlite = { git = "https://github.com/Spxg/rusqlite.git", optional = true, branch = "wasm-demo" } # sqlx = { version = "0.8.3", features = ["sqlite"], optional = true } # sqlx = { path = "../../remote/sqlx", features = ["sqlite"], optional = true } diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 2499ca8..47ca497 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, error::Error, fmt::Display, str::FromStr}; -#[cfg(feature = "sqlx")] -use sqlx::Sqlite; +// #[cfg(feature = "sqlx")] +// use sqlx::Sqlite; #[derive(PartialEq, Debug, Clone, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -57,34 +57,34 @@ impl From for rusqlite::types::FromSqlError { } } -#[cfg(feature = "sqlx")] -impl sqlx::Type for JID { - fn type_info() -> ::TypeInfo { - <&str as sqlx::Type>::type_info() - } -} - -#[cfg(feature = "sqlx")] -impl sqlx::Decode<'_, Sqlite> for JID { - fn decode( - value: ::ValueRef<'_>, - ) -> Result { - let value = <&str as sqlx::Decode>::decode(value)?; - - Ok(value.parse()?) - } -} - -#[cfg(feature = "sqlx")] -impl sqlx::Encode<'_, Sqlite> for JID { - fn encode_by_ref( - &self, - buf: &mut ::ArgumentBuffer<'_>, - ) -> Result { - let jid = self.to_string(); - >::encode(jid, buf) - } -} +// #[cfg(feature = "sqlx")] +// impl sqlx::Type for JID { +// fn type_info() -> ::TypeInfo { +// <&str as sqlx::Type>::type_info() +// } +// } + +// #[cfg(feature = "sqlx")] +// impl sqlx::Decode<'_, Sqlite> for JID { +// fn decode( +// value: ::ValueRef<'_>, +// ) -> Result { +// let value = <&str as sqlx::Decode>::decode(value)?; + +// Ok(value.parse()?) +// } +// } + +// #[cfg(feature = "sqlx")] +// impl sqlx::Encode<'_, Sqlite> for JID { +// fn encode_by_ref( +// &self, +// buf: &mut ::ArgumentBuffer<'_>, +// ) -> Result { +// let jid = self.to_string(); +// >::encode(jid, buf) +// } +// } #[derive(Debug, Clone)] pub enum JIDError { -- cgit