@@ -79,15 +79,15 @@ use crate::codec::JsonCodec;
7979pub use anyhow:: Error ;
8080use anyhow:: Result ;
8181use core:: fmt:: Debug ;
82- use futures_util:: sink:: SinkExt ;
8382use futures_util:: StreamExt ;
83+ use futures_util:: sink:: SinkExt ;
8484use log:: { debug, trace} ;
85- use serde:: { de:: DeserializeOwned , Serialize } ;
85+ use serde:: { Serialize , de:: DeserializeOwned } ;
8686use std:: path:: Path ;
8787use std:: sync:: atomic:: AtomicUsize ;
8888use std:: sync:: atomic:: Ordering ;
89- use tokio:: net:: unix:: { OwnedReadHalf , OwnedWriteHalf } ;
9089use tokio:: net:: UnixStream ;
90+ use tokio:: net:: unix:: { OwnedReadHalf , OwnedWriteHalf } ;
9191use tokio_util:: codec:: { FramedRead , FramedWrite } ;
9292
9393pub mod codec;
@@ -559,8 +559,11 @@ mod test {
559559 #[ test]
560560 fn serialize_custom_msg_notification ( ) {
561561 let msg = CustomMsgNotification {
562- peer_id : PublicKey :: from_str ( "0364aeb75519be29d1af7b8cc6232dbda9fdabb79b66e4e1f6a223750954db210b" ) . unwrap ( ) ,
563- payload : String :: from ( "941746573749" )
562+ peer_id : PublicKey :: from_str (
563+ "0364aeb75519be29d1af7b8cc6232dbda9fdabb79b66e4e1f6a223750954db210b" ,
564+ )
565+ . unwrap ( ) ,
566+ payload : String :: from ( "941746573749" ) ,
564567 } ;
565568
566569 let notification = Notification :: CustomMsg ( msg) ;
@@ -576,14 +579,16 @@ mod test {
576579 }
577580 )
578581 ) ;
579-
580582 }
581583
582584 #[ test]
583585 fn serialize_block_added_notification ( ) {
584586 let block_added = BlockAddedNotification {
585- hash : crate :: primitives:: Sha256 :: from_str ( "000000000000000000000acab8abe0c67a52ed7e5a90a19c64930ff11fa84eca" ) . unwrap ( ) ,
586- height : 830702
587+ hash : crate :: primitives:: Sha256 :: from_str (
588+ "000000000000000000000acab8abe0c67a52ed7e5a90a19c64930ff11fa84eca" ,
589+ )
590+ . unwrap ( ) ,
591+ height : 830702 ,
587592 } ;
588593
589594 let notification = Notification :: BlockAdded ( block_added) ;
@@ -613,6 +618,6 @@ mod test {
613618 }
614619 } ) ;
615620
616- let _ : Notification = serde_json:: from_value ( connect_json) . unwrap ( ) ;
621+ let _: Notification = serde_json:: from_value ( connect_json) . unwrap ( ) ;
617622 }
618623}
0 commit comments