Skip to content

Commit

Permalink
chore: NostrModule has default() fn instead of new()
Browse files Browse the repository at this point in the history
  • Loading branch information
tvolk131 committed Oct 1, 2024
1 parent 4294ded commit 9c9c8e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/nostr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@ pub enum NostrModuleMessage {
DisconnectFromRelay(String),
}

#[derive(Clone)]
#[derive(Clone, Default)]
pub struct NostrModule {
client: nostr_sdk::Client,
}

impl NostrModule {
pub fn new() -> Self {
Self {
client: nostr_sdk::Client::default(),
}
}

pub fn update(&self, message: NostrModuleMessage) {
match message {
NostrModuleMessage::ConnectToRelay(url) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Page {
wallet_clone.connect_to_joined_federations().await.unwrap();
});

let nostr_module = NostrModule::new();
let nostr_module = NostrModule::default();

// TODO: Add pagination.
let relays = db.list_relays(999, 0).unwrap();
Expand Down

0 comments on commit 9c9c8e4

Please sign in to comment.