@@ -83,7 +83,7 @@ pub trait ToSocketAddrsDomain: ToSocketAddrs {
8383
8484impl ToSocketAddrsDomain for & str {
8585 fn domain ( & self ) -> Option < & str > {
86- self . splitn ( 2 , ':' ) . next ( )
86+ self . split ( ':' ) . next ( )
8787 }
8888}
8989
@@ -406,11 +406,11 @@ impl RawClient<ElectrumSslStream> {
406406 socket_addr. domain ( ) . ok_or ( Error :: MissingDomain ) ?;
407407
408408 let store = webpki_roots:: TLS_SERVER_ROOTS
409- . into_iter ( )
409+ . iter ( )
410410 . map ( |t| TrustAnchor {
411411 subject : Der :: from_slice ( t. subject ) ,
412412 subject_public_key_info : Der :: from_slice ( t. spki ) ,
413- name_constraints : t. name_constraints . map ( |nc| Der :: from_slice ( nc ) ) ,
413+ name_constraints : t. name_constraints . map ( Der :: from_slice) ,
414414 } )
415415 . collect :: < RootCertStore > ( ) ;
416416
@@ -605,7 +605,7 @@ impl<S: Read + Write> RawClient<S> {
605605 // No id, that's probably a notification.
606606 let mut resp = resp;
607607
608- if let Some ( ref method) = resp[ "method" ] . take ( ) . as_str ( ) {
608+ if let Some ( method) = resp[ "method" ] . take ( ) . as_str ( ) {
609609 self . handle_notification ( method, resp[ "params" ] . take ( ) ) ?;
610610 } else {
611611 warn ! ( "Unexpected response: {:?}" , resp) ;
@@ -722,7 +722,7 @@ impl<S: Read + Write> RawClient<S> {
722722 ) -> Result < serde_json:: Value , Error > {
723723 let req = Request :: new_id (
724724 self . last_id . fetch_add ( 1 , Ordering :: SeqCst ) ,
725- & method_name,
725+ method_name,
726726 params,
727727 ) ;
728728 let result = self . call ( req) ?;
@@ -763,7 +763,7 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
763763 for ( method, params) in batch. iter ( ) {
764764 let req = Request :: new_id (
765765 self . last_id . fetch_add ( 1 , Ordering :: SeqCst ) ,
766- & method,
766+ method,
767767 params. to_vec ( ) ,
768768 ) ;
769769 missing_responses. insert ( req. id ) ;
@@ -804,7 +804,7 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
804804 } ;
805805 }
806806
807- Ok ( answers. into_iter ( ) . map ( | ( _ , r ) | r ) . collect ( ) )
807+ Ok ( answers. into_values ( ) . collect ( ) )
808808 }
809809
810810 fn block_headers_subscribe_raw ( & self ) -> Result < RawHeaderNotification , Error > {
@@ -1128,7 +1128,7 @@ mod test {
11281128 use crate :: utils;
11291129
11301130 use super :: RawClient ;
1131- use api:: ElectrumApi ;
1131+ use crate :: api:: ElectrumApi ;
11321132
11331133 fn get_test_server ( ) -> String {
11341134 std:: env:: var ( "TEST_ELECTRUM_SERVER" ) . unwrap_or ( "electrum.blockstream.info:50001" . into ( ) )
@@ -1426,7 +1426,7 @@ mod test {
14261426
14271427 #[ test]
14281428 fn test_raw_call ( ) {
1429- use types:: Param ;
1429+ use crate :: types:: Param ;
14301430
14311431 let client = RawClient :: new ( get_test_server ( ) , None ) . unwrap ( ) ;
14321432
0 commit comments