summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-30 15:09:02 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-30 15:09:02 +0100
commit65757276a311d806d3041dcb861f9110186ace89 (patch)
treed692a16309cf767c47e002ed88a03a048dd0976e
parent46927eaee5d5e48a0039c660681be9823dcf3ff5 (diff)
downloadsentrum-65757276a311d806d3041dcb861f9110186ace89.tar.gz
sentrum-65757276a311d806d3041dcb861f9110186ace89.tar.bz2
sentrum-65757276a311d806d3041dcb861f9110186ace89.zip
Use serde_json directly
Instead of relying on nostr_sdk reexport
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml1
-rw-r--r--src/actions/nostr.rs22
3 files changed, 14 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 591c51c..d7960b5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2904,6 +2904,7 @@ dependencies = [
"pretty_env_logger",
"regex",
"serde",
+ "serde_json",
"strfmt",
"systemd-directories",
"teloxide",
diff --git a/Cargo.toml b/Cargo.toml
index 12f5617..41b60aa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,6 +42,7 @@ teloxide = { version = "0.12.2", optional = true }
nostr-sdk = { version = "0.30.0", features = ["nip04", "nip05", "nip44", "nip59"], default-features = false, optional = true }
nostr-relay-pool = { version = "0.30.0", optional = true }
regex = "1.10.4"
+serde_json = "1.0.116"
[target.aarch64-unknown-linux-gnu.dependencies]
openssl = { version = "0.10.64", features = ["vendored"] }
diff --git a/src/actions/nostr.rs b/src/actions/nostr.rs
index 6ad91b5..f4ecb86 100644
--- a/src/actions/nostr.rs
+++ b/src/actions/nostr.rs
@@ -1,14 +1,15 @@
-use super::Action;
-use crate::message::MessageConfig;
-use crate::message::MessageParams;
+use std::fs::File;
+use std::io::BufReader;
+use std::io::Write;
+use std::net::SocketAddr;
+use std::path::PathBuf;
+
use anyhow::{Context, Result};
use async_scoped::TokioScope;
use async_trait::async_trait;
use const_format::formatcp;
use nostr_relay_pool::RelayOptions;
use nostr_sdk::nips::nip05;
-use nostr_sdk::serde_json::from_reader;
-use nostr_sdk::serde_json::to_string;
use nostr_sdk::Client;
use nostr_sdk::Keys;
use nostr_sdk::Metadata;
@@ -16,11 +17,12 @@ use nostr_sdk::PublicKey;
use nostr_sdk::ToBech32;
use serde::Deserialize;
use serde::Serialize;
-use std::fs::File;
-use std::io::BufReader;
-use std::io::Write;
-use std::net::SocketAddr;
-use std::path::PathBuf;
+use serde_json::from_reader;
+use serde_json::to_string;
+
+use super::Action;
+use crate::message::MessageConfig;
+use crate::message::MessageParams;
#[derive(Debug, Clone, Deserialize, Serialize)]
struct NostrData {