@@ -46,7 +46,7 @@ impl NostrModule {
46
46
pub fn subscription ( & self ) -> Subscription < NostrState > {
47
47
const POLL_DURATION : Duration = Duration :: from_millis ( 200 ) ;
48
48
49
- let client = self . client . clone ( ) ;
49
+ let self_clone = self . clone ( ) ;
50
50
51
51
Subscription :: run_with_id (
52
52
std:: any:: TypeId :: of :: < NostrState > ( ) ,
@@ -57,7 +57,7 @@ impl NostrModule {
57
57
async_stream:: stream! {
58
58
let mut last_state = NostrState :: default ( ) ;
59
59
loop {
60
- let new_state = Self :: get_state( & client ) . await ;
60
+ let new_state = self_clone . get_state( ) . await ;
61
61
if new_state != last_state {
62
62
yield new_state. clone( ) ;
63
63
last_state = new_state;
@@ -72,10 +72,10 @@ impl NostrModule {
72
72
/// Fetches the current state of the Nostr SDK client.
73
73
/// Note: This is async because it's grabbing read locks
74
74
/// on the relay `RwLock`s. No network requests are made.
75
- async fn get_state ( client : & nostr_sdk :: Client ) -> NostrState {
75
+ async fn get_state ( & self ) -> NostrState {
76
76
let mut relay_connections = BTreeMap :: new ( ) ;
77
77
78
- for ( url, relay) in client. relays ( ) . await {
78
+ for ( url, relay) in self . client . relays ( ) . await {
79
79
relay_connections. insert ( url. clone ( ) , relay. status ( ) . await ) ;
80
80
}
81
81
0 commit comments