File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed
Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -49,22 +49,25 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
4949 }
5050
5151 // Inner loop: process until disconnect
52- while let Ok ( update) = handle. subscription_receiver . recv ( ) . await {
53- match & update. message {
54- RithmicMessage :: HeartbeatTimeout
55- | RithmicMessage :: ForcedLogout ( _)
56- | RithmicMessage :: ConnectionError => {
57- warn ! ( "Disconnected, reconnecting..." ) ;
58- break ;
59- }
60- RithmicMessage :: LastTrade ( t) => {
61- info ! (
62- "Trade: {} @ {}" ,
63- t. trade_size. unwrap_or( 0 ) ,
64- t. trade_price. unwrap_or( 0.0 )
65- ) ;
66- }
67- _ => { }
52+ loop {
53+ match handle. subscription_receiver . recv ( ) . await {
54+ Ok ( update) => match & update. message {
55+ RithmicMessage :: HeartbeatTimeout
56+ | RithmicMessage :: ForcedLogout ( _)
57+ | RithmicMessage :: ConnectionError => {
58+ warn ! ( "Disconnected, reconnecting..." ) ;
59+ break ;
60+ }
61+ RithmicMessage :: LastTrade ( t) => {
62+ info ! (
63+ "Trade: {} @ {}" ,
64+ t. trade_size. unwrap_or( 0 ) ,
65+ t. trade_price. unwrap_or( 0.0 )
66+ ) ;
67+ }
68+ _ => { }
69+ } ,
70+ Err ( _) => break ,
6871 }
6972 }
7073
You can’t perform that action at this time.
0 commit comments