@@ -363,15 +363,15 @@ impl IoHandler<Message> for Handler {
363363 const CHECK_BOOTSTRAP_INTERVAL : Duration = Duration :: from_secs ( 15 ) ;
364364 io. register_timer_once ( CONNECT_TO_BOOTSTRAP , CHECK_BOOTSTRAP_INTERVAL ) ;
365365 }
366- FIRST_WAIT_SYNC ... LAST_WAIT_SYNC => {
366+ FIRST_WAIT_SYNC ..= LAST_WAIT_SYNC => {
367367 cwarn ! ( NETWORK , "No sync message from {}" , timer) ;
368368 io. deregister_stream ( wait_sync_stream ( timer) ) ;
369369 }
370- FIRST_WAIT_ACK ... LAST_WAIT_ACK => {
370+ FIRST_WAIT_ACK ..= LAST_WAIT_ACK => {
371371 cwarn ! ( NETWORK , "No ack message from {}" , timer) ;
372372 io. deregister_stream ( wait_ack_stream ( timer) ) ;
373373 }
374- FIRST_TRY_SYNC ... LAST_TRY_SYNC => {
374+ FIRST_TRY_SYNC ..= LAST_TRY_SYNC => {
375375 let stream = retry_sync_stream ( timer) ;
376376 let mut outgoing_connections = self . outgoing_connections . write ( ) ;
377377 if let Some ( con) = outgoing_connections. get_mut ( & stream) {
@@ -430,7 +430,7 @@ impl IoHandler<Message> for Handler {
430430 let stream =
431431 * self . remote_node_ids_reverse . read ( ) . get ( & node_id) . ok_or_else ( || Error :: InvalidNode ( node_id) ) ?;
432432 let ( network_message_size, peer_addr) = match stream {
433- FIRST_OUTBOUND ... LAST_OUTBOUND => {
433+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
434434 let mut outbound_connections = self . outbound_connections . write ( ) ;
435435 if let Some ( con) = outbound_connections. get_mut ( & stream) {
436436 let _f = finally ( || {
@@ -445,7 +445,7 @@ impl IoHandler<Message> for Handler {
445445 return Err ( format ! ( "{} is an invalid stream" , stream) . into ( ) )
446446 }
447447 }
448- FIRST_INBOUND ... LAST_INBOUND => {
448+ FIRST_INBOUND ..= LAST_INBOUND => {
449449 let mut inbound_connections = self . inbound_connections . write ( ) ;
450450 if let Some ( con) = inbound_connections. get_mut ( & stream) {
451451 let _f = finally ( || {
@@ -577,19 +577,19 @@ impl IoHandler<Message> for Handler {
577577
578578 fn stream_hup ( & self , io : & IoContext < Message > , stream : StreamToken ) -> IoHandlerResult < ( ) > {
579579 match stream {
580- FIRST_INBOUND ... LAST_INBOUND => {
580+ FIRST_INBOUND ..= LAST_INBOUND => {
581581 cinfo ! ( NETWORK , "Hang-up inbound stream({})" , stream) ;
582582 io. deregister_stream ( stream) ;
583583 }
584- FIRST_OUTBOUND ... LAST_OUTBOUND => {
584+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
585585 cinfo ! ( NETWORK , "Hang-up outbound stream({})" , stream) ;
586586 io. deregister_stream ( stream) ;
587587 }
588- FIRST_INCOMING ... LAST_INCOMING => {
588+ FIRST_INCOMING ..= LAST_INCOMING => {
589589 cinfo ! ( NETWORK , "Hang-up incoming stream({})" , stream) ;
590590 io. deregister_stream ( stream) ;
591591 }
592- FIRST_OUTGOING ... LAST_OUTGOING => {
592+ FIRST_OUTGOING ..= LAST_OUTGOING => {
593593 cinfo ! ( NETWORK , "Hang-up outgoing stream({})" , stream) ;
594594 io. deregister_stream ( stream) ;
595595 }
@@ -647,7 +647,7 @@ impl IoHandler<Message> for Handler {
647647 io. register_timer_once ( wait_sync_timer ( token) , WAIT_SYNC ) ;
648648 }
649649 }
650- FIRST_INBOUND ... LAST_INBOUND => {
650+ FIRST_INBOUND ..= LAST_INBOUND => {
651651 let mut inbound_connections = self . inbound_connections . write ( ) ;
652652 if let Some ( con) = inbound_connections. get_mut ( & stream_token) {
653653 let should_update = AtomicBool :: new ( true ) ;
@@ -716,7 +716,7 @@ impl IoHandler<Message> for Handler {
716716 cdebug ! ( NETWORK , "Invalid inbound token({}) on read" , stream_token) ;
717717 }
718718 }
719- FIRST_OUTBOUND ... LAST_OUTBOUND => {
719+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
720720 let mut outbound_connections = self . outbound_connections . write ( ) ;
721721 if let Some ( con) = outbound_connections. get_mut ( & stream_token) {
722722 let should_update = AtomicBool :: new ( true ) ;
@@ -761,7 +761,7 @@ impl IoHandler<Message> for Handler {
761761 cdebug ! ( NETWORK , "Invalid outbound token({}) on read" , stream_token) ;
762762 }
763763 }
764- FIRST_INCOMING ... LAST_INCOMING => {
764+ FIRST_INCOMING ..= LAST_INCOMING => {
765765 let mut incoming_connections = self . incoming_connections . write ( ) ;
766766 if let Some ( con) = incoming_connections. get_mut ( & stream_token) {
767767 let should_update = AtomicBool :: new ( true ) ;
@@ -855,7 +855,7 @@ impl IoHandler<Message> for Handler {
855855 cdebug ! ( NETWORK , "Invalid incoming token({}) on read" , stream_token) ;
856856 }
857857 }
858- FIRST_OUTGOING ... LAST_OUTGOING => {
858+ FIRST_OUTGOING ..= LAST_OUTGOING => {
859859 let mut outgoing_connections = self . outgoing_connections . write ( ) ;
860860 if let Some ( con) = outgoing_connections. get_mut ( & stream_token) {
861861 let should_update = AtomicBool :: new ( true ) ;
@@ -904,28 +904,28 @@ impl IoHandler<Message> for Handler {
904904
905905 fn stream_writable ( & self , _io : & IoContext < Message > , stream : StreamToken ) -> IoHandlerResult < ( ) > {
906906 match stream {
907- FIRST_INBOUND ... LAST_INBOUND => {
907+ FIRST_INBOUND ..= LAST_INBOUND => {
908908 if let Some ( con) = self . inbound_connections . write ( ) . get_mut ( & stream) {
909909 con. flush ( ) ?;
910910 } else {
911911 cdebug ! ( NETWORK , "Invalid inbound token({}) on write" , stream) ;
912912 }
913913 }
914- FIRST_OUTBOUND ... LAST_OUTBOUND => {
914+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
915915 if let Some ( con) = self . outbound_connections . write ( ) . get_mut ( & stream) {
916916 con. flush ( ) ?;
917917 } else {
918918 cdebug ! ( NETWORK , "Invalid outbound token({}) on write" , stream) ;
919919 }
920920 }
921- FIRST_INCOMING ... LAST_INCOMING => {
921+ FIRST_INCOMING ..= LAST_INCOMING => {
922922 if let Some ( con) = self . incoming_connections . write ( ) . get_mut ( & stream) {
923923 con. flush ( ) ?;
924924 } else {
925925 cdebug ! ( NETWORK , "Invalid incoming token({}) on write" , stream) ;
926926 }
927927 }
928- FIRST_OUTGOING ... LAST_OUTGOING => {
928+ FIRST_OUTGOING ..= LAST_OUTGOING => {
929929 if let Some ( con) = self . outgoing_connections . write ( ) . get_mut ( & stream) {
930930 con. flush ( ) ?;
931931 } else {
@@ -948,31 +948,31 @@ impl IoHandler<Message> for Handler {
948948 event_loop. register ( & self . listener , reg, Ready :: readable ( ) , PollOpt :: edge ( ) ) ?;
949949 ctrace ! ( NETWORK , "TCP connection starts for {}" , self . socket_address) ;
950950 }
951- FIRST_INBOUND ... LAST_INBOUND => {
951+ FIRST_INBOUND ..= LAST_INBOUND => {
952952 if let Some ( con) = self . inbound_connections . read ( ) . get ( & stream) {
953953 con. register ( reg, event_loop) ?;
954954 ctrace ! ( NETWORK , "Inbound connect({}) registered" , stream) ;
955955 } else {
956956 cdebug ! ( NETWORK , "Invalid inbound token({}) on register" , stream) ;
957957 }
958958 }
959- FIRST_OUTBOUND ... LAST_OUTBOUND => {
959+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
960960 if let Some ( con) = self . outbound_connections . read ( ) . get ( & stream) {
961961 con. register ( reg, event_loop) ?;
962962 ctrace ! ( NETWORK , "Outbound connect({}) registered" , stream) ;
963963 } else {
964964 cdebug ! ( NETWORK , "Invalid outbound token({}) on register" , stream) ;
965965 }
966966 }
967- FIRST_INCOMING ... LAST_INCOMING => {
967+ FIRST_INCOMING ..= LAST_INCOMING => {
968968 if let Some ( con) = self . incoming_connections . read ( ) . get ( & stream) {
969969 con. register ( reg, event_loop) ?;
970970 ctrace ! ( NETWORK , "Incoming connect({}) registered" , stream) ;
971971 } else {
972972 cdebug ! ( NETWORK , "Invalid incoming token({}) on register" , stream) ;
973973 }
974974 }
975- FIRST_OUTGOING ... LAST_OUTGOING => {
975+ FIRST_OUTGOING ..= LAST_OUTGOING => {
976976 if let Some ( con) = self . outgoing_connections . read ( ) . get ( & stream) {
977977 con. register ( reg, event_loop) ?;
978978 ctrace ! ( NETWORK , "Outgoing connect({}) registered" , stream) ;
@@ -1000,31 +1000,31 @@ impl IoHandler<Message> for Handler {
10001000 ACCEPT => {
10011001 event_loop. reregister ( & self . listener , reg, Ready :: readable ( ) , PollOpt :: edge ( ) ) ?;
10021002 }
1003- FIRST_INBOUND ... LAST_INBOUND => {
1003+ FIRST_INBOUND ..= LAST_INBOUND => {
10041004 if let Some ( con) = self . inbound_connections . read ( ) . get ( & stream) {
10051005 con. reregister ( reg, event_loop) ?;
10061006 ctrace ! ( NETWORK , "Inbound connect({}) updated" , stream) ;
10071007 } else {
10081008 cdebug ! ( NETWORK , "Invalid inbound token({}) on update" , stream) ;
10091009 }
10101010 }
1011- FIRST_OUTBOUND ... LAST_OUTBOUND => {
1011+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
10121012 if let Some ( con) = self . outbound_connections . read ( ) . get ( & stream) {
10131013 con. reregister ( reg, event_loop) ?;
10141014 ctrace ! ( NETWORK , "Outbound connect({}) updated" , stream) ;
10151015 } else {
10161016 cdebug ! ( NETWORK , "Invalid outbound token({}) on update" , stream) ;
10171017 }
10181018 }
1019- FIRST_INCOMING ... LAST_INCOMING => {
1019+ FIRST_INCOMING ..= LAST_INCOMING => {
10201020 if let Some ( con) = self . incoming_connections . read ( ) . get ( & stream) {
10211021 con. reregister ( reg, event_loop) ?;
10221022 ctrace ! ( NETWORK , "Incoming connect({}) updated" , stream) ;
10231023 } else {
10241024 cdebug ! ( NETWORK , "Invalid incoming token({}) on update" , stream) ;
10251025 }
10261026 }
1027- FIRST_OUTGOING ... LAST_OUTGOING => {
1027+ FIRST_OUTGOING ..= LAST_OUTGOING => {
10281028 if let Some ( con) = self . outgoing_connections . read ( ) . get ( & stream) {
10291029 con. reregister ( reg, event_loop) ?;
10301030 ctrace ! ( NETWORK , "Outgoing connect({}) updated" , stream) ;
@@ -1044,7 +1044,7 @@ impl IoHandler<Message> for Handler {
10441044 ) -> IoHandlerResult < ( ) > {
10451045 self . channel . send ( Message :: StartConnect ) ?;
10461046 match stream {
1047- FIRST_INBOUND ... LAST_INBOUND => {
1047+ FIRST_INBOUND ..= LAST_INBOUND => {
10481048 let mut inbound_connections = self . inbound_connections . write ( ) ;
10491049 if let Some ( con) = inbound_connections. remove ( & stream) {
10501050 if let Some ( node_id) = self . remote_node_ids . write ( ) . remove ( & stream) {
@@ -1061,7 +1061,7 @@ impl IoHandler<Message> for Handler {
10611061 cdebug ! ( NETWORK , "Invalid inbound token({}) on deregister" , stream) ;
10621062 }
10631063 }
1064- FIRST_OUTBOUND ... LAST_OUTBOUND => {
1064+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
10651065 let mut outbound_connections = self . outbound_connections . write ( ) ;
10661066 if let Some ( con) = outbound_connections. remove ( & stream) {
10671067 if let Some ( node_id) = self . remote_node_ids . write ( ) . remove ( & stream) {
@@ -1078,7 +1078,7 @@ impl IoHandler<Message> for Handler {
10781078 cdebug ! ( NETWORK , "Invalid outbound token({}) on deregister" , stream) ;
10791079 }
10801080 }
1081- FIRST_INCOMING ... LAST_INCOMING => {
1081+ FIRST_INCOMING ..= LAST_INCOMING => {
10821082 let mut incoming_connections = self . incoming_connections . write ( ) ;
10831083 if let Some ( con) = incoming_connections. remove ( & stream) {
10841084 con. deregister ( event_loop) ?;
@@ -1107,7 +1107,7 @@ impl IoHandler<Message> for Handler {
11071107 cdebug ! ( NETWORK , "Invalid incoming token({}) on deregister" , stream) ;
11081108 }
11091109 }
1110- FIRST_OUTGOING ... LAST_OUTGOING => {
1110+ FIRST_OUTGOING ..= LAST_OUTGOING => {
11111111 let mut outgoing_connections = self . outgoing_connections . write ( ) ;
11121112 if let Some ( con) = outgoing_connections. remove ( & stream) {
11131113 con. deregister ( event_loop) ?;
0 commit comments