commit f617fb2c3785197093549ee3e72d73b5a51d52dd
parent 1a022d988d963178d9f8ceb167060b8e3266e92f
Author: triesap <tyson@radroots.org>
Date: Sun, 15 Feb 2026 17:51:03 +0000
net-core: apply cargo fmt
Diffstat:
6 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/net-core/src/keys.rs b/net-core/src/keys.rs
@@ -4,9 +4,7 @@ use crate::config::{KeyFormat, KeyPersistenceConfig};
use crate::error::{NetError, Result};
#[cfg(feature = "nostr-client")]
use radroots_nostr::prelude::{
- RadrootsNostrKeys,
- RadrootsNostrSecretKey,
- RadrootsNostrSecp256k1SecretKey,
+ RadrootsNostrKeys, RadrootsNostrSecp256k1SecretKey, RadrootsNostrSecretKey,
RadrootsNostrToBech32,
};
#[cfg(feature = "nostr-client")]
@@ -67,8 +65,8 @@ impl KeysManager {
}
pub fn load_from_secret_bytes(&mut self, sk: &[u8; 32]) -> Result<()> {
- let secp =
- RadrootsNostrSecp256k1SecretKey::from_slice(&sk[..]).map_err(|_| NetError::InvalidHex32)?;
+ let secp = RadrootsNostrSecp256k1SecretKey::from_slice(&sk[..])
+ .map_err(|_| NetError::InvalidHex32)?;
let nostr_sk = RadrootsNostrSecretKey::from(secp);
let keys = RadrootsNostrKeys::new(nostr_sk);
self.set_keys(keys);
@@ -88,8 +86,8 @@ impl KeysManager {
pub fn load_from_nsec(&mut self, nsec: &str) -> Result<()> {
use secrecy::{ExposeSecret, SecretString};
let secret = SecretString::new(nsec.to_owned().into());
- let keys =
- RadrootsNostrKeys::parse(secret.expose_secret()).map_err(|_| NetError::InvalidBech32)?;
+ let keys = RadrootsNostrKeys::parse(secret.expose_secret())
+ .map_err(|_| NetError::InvalidBech32)?;
self.set_keys(keys);
Ok(())
}
diff --git a/net-core/src/nostr_client/events/custom.rs b/net-core/src/nostr_client/events/custom.rs
@@ -2,10 +2,7 @@
use crate::error::{NetError, Result};
use radroots_nostr::prelude::{
- radroots_nostr_build_event,
- radroots_nostr_send_event,
- RadrootsNostrEvent,
- RadrootsNostrFilter,
+ RadrootsNostrEvent, RadrootsNostrFilter, radroots_nostr_build_event, radroots_nostr_send_event,
};
use crate::nostr_client::manager::NostrClientManager;
diff --git a/net-core/src/nostr_client/events/post.rs b/net-core/src/nostr_client/events/post.rs
@@ -1,10 +1,8 @@
use crate::error::{NetError, Result};
use radroots_events::post::RadrootsPostEventMetadata;
use radroots_nostr::prelude::{
- radroots_nostr_build_post_event,
- radroots_nostr_build_post_reply_event,
- radroots_nostr_fetch_post_events,
- radroots_nostr_send_event,
+ radroots_nostr_build_post_event, radroots_nostr_build_post_reply_event,
+ radroots_nostr_fetch_post_events, radroots_nostr_send_event,
};
use crate::nostr_client::manager::NostrClientManager;
diff --git a/net-core/src/nostr_client/events/profile.rs b/net-core/src/nostr_client/events/profile.rs
@@ -1,10 +1,8 @@
use crate::error::{NetError, Result};
use radroots_events::profile::RadrootsProfileEventMetadata;
use radroots_nostr::prelude::{
- radroots_nostr_fetch_metadata_for_author,
+ RadrootsNostrMetadata, RadrootsNostrPublicKey, radroots_nostr_fetch_metadata_for_author,
radroots_nostr_post_metadata_event,
- RadrootsNostrMetadata,
- RadrootsNostrPublicKey,
};
use crate::nostr_client::manager::NostrClientManager;
diff --git a/net-core/src/nostr_client/inner.rs b/net-core/src/nostr_client/inner.rs
@@ -3,10 +3,7 @@ use std::sync::{Arc, Mutex};
use radroots_events::post::RadrootsPostEventMetadata;
use radroots_nostr::prelude::{
- RadrootsNostrClient,
- RadrootsNostrKeys,
- RadrootsNostrMonitor,
- RadrootsNostrRelayStatus,
+ RadrootsNostrClient, RadrootsNostrKeys, RadrootsNostrMonitor, RadrootsNostrRelayStatus,
RadrootsNostrRelayUrl,
};
use tokio::runtime::Handle;
diff --git a/net-core/src/nostr_client/status.rs b/net-core/src/nostr_client/status.rs
@@ -1,7 +1,4 @@
-use radroots_nostr::prelude::{
- RadrootsNostrMonitorNotification,
- RadrootsNostrRelayStatus,
-};
+use radroots_nostr::prelude::{RadrootsNostrMonitorNotification, RadrootsNostrRelayStatus};
use tracing::{info, warn};
use super::manager::NostrClientManager;