File tree Expand file tree Collapse file tree 6 files changed +16
-9
lines changed Expand file tree Collapse file tree 6 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 2828### Breaking changes
2929
3030- Change ` Relay::send_msg ` and ` Relay::batch_msg ` signatures (https://github.com/rust-nostr/nostr/pull/1124 )
31+ - Change ` RelayPool::batch_msg ` signature (https://github.com/rust-nostr/nostr/pull/1124 )
3132
3233## v0.44.0 - 2025/11/06
3334
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ impl RelayPool {
659659 U : TryIntoUrl ,
660660 Error : From < <U as TryIntoUrl >:: Err > ,
661661 {
662- self . batch_msg_to ( urls, vec ! [ msg] ) . await
662+ self . batch_msg_to ( urls, & [ msg] ) . await
663663 }
664664
665665 /// Send multiple client messages at once to specific relays
@@ -668,7 +668,7 @@ impl RelayPool {
668668 pub async fn batch_msg_to < I , U > (
669669 & self ,
670670 urls : I ,
671- msgs : Vec < ClientMessage < ' _ > > ,
671+ msgs : & [ ClientMessage < ' _ > ] ,
672672 ) -> Result < Output < ( ) > , Error >
673673 where
674674 I : IntoIterator < Item = U > ,
@@ -713,7 +713,7 @@ impl RelayPool {
713713 for url in set. into_iter ( ) {
714714 let relay: & Relay = self . internal_relay ( & relays, & url) ?;
715715 urls. push ( url) ;
716- futures. push ( relay. batch_msg ( msgs. clone ( ) ) ) ;
716+ futures. push ( relay. batch_msg ( msgs) ) ;
717717 }
718718
719719 // Join futures
Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ impl RelayChannels {
8686
8787 fn send_client_msgs (
8888 & self ,
89- msgs : Vec < ClientMessage > ,
89+ msgs : & [ ClientMessage ] ,
9090 confirmation : Option < oneshot:: Sender < ( ) > > ,
9191 ) -> Result < ( ) , Error > {
9292 // Serialize messages to JSON
93- let msgs: Vec < ClientMessageJson > = msgs. into_iter ( ) . map ( |msg| msg. as_json ( ) ) . collect ( ) ;
93+ let msgs: Vec < ClientMessageJson > = msgs. iter ( ) . map ( |msg| msg. as_json ( ) ) . collect ( ) ;
9494
9595 // Build request
9696 let req: SendMessageRequest = SendMessageRequest { msgs, confirmation } ;
@@ -1325,10 +1325,10 @@ impl InnerRelay {
13251325
13261326 #[ inline]
13271327 pub async fn send_msg ( & self , msg : ClientMessage < ' _ > ) -> Result < ( ) , Error > {
1328- self . batch_msg ( vec ! [ msg] ) . await
1328+ self . batch_msg ( & [ msg] ) . await
13291329 }
13301330
1331- pub async fn batch_msg ( & self , msgs : Vec < ClientMessage < ' _ > > ) -> Result < ( ) , Error > {
1331+ pub async fn batch_msg ( & self , msgs : & [ ClientMessage < ' _ > ] ) -> Result < ( ) , Error > {
13321332 // Check if relay is operational
13331333 self . ensure_operational ( ) ?;
13341334
Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ impl Relay {
411411
412412 /// Send multiple [`ClientMessage`] at once
413413 #[ inline]
414- pub async fn batch_msg ( & self , msgs : Vec < ClientMessage < ' _ > > ) -> Result < ( ) , Error > {
414+ pub async fn batch_msg ( & self , msgs : & [ ClientMessage < ' _ > ] ) -> Result < ( ) , Error > {
415415 self . inner . batch_msg ( msgs) . await
416416 }
417417
Original file line number Diff line number Diff line change 2323
2424-->
2525
26+ ## Unreleased
27+
28+ ### Breaking changes
29+
30+ - Change ` Client::batch_msg ` signature (https://github.com/rust-nostr/nostr/pull/1124 )
31+
2632## v0.44.0 - 2025/11/06
2733
2834### Breaking changes
Original file line number Diff line number Diff line change @@ -935,7 +935,7 @@ impl Client {
935935 pub async fn batch_msg_to < I , U > (
936936 & self ,
937937 urls : I ,
938- msgs : Vec < ClientMessage < ' _ > > ,
938+ msgs : & [ ClientMessage < ' _ > ] ,
939939 ) -> Result < Output < ( ) > , Error >
940940 where
941941 I : IntoIterator < Item = U > ,
You can’t perform that action at this time.
0 commit comments