From 598126f9ad755fd990a5abff70ca534c5a224889 Mon Sep 17 00:00:00 2001 From: Arthur LE MOIGNE Date: Tue, 14 Nov 2023 22:43:35 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Update=20REPL=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickfix/examples/fix_repl.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/quickfix/examples/fix_repl.rs b/quickfix/examples/fix_repl.rs index a34aef6..e5abea2 100644 --- a/quickfix/examples/fix_repl.rs +++ b/quickfix/examples/fix_repl.rs @@ -30,34 +30,36 @@ fn main() { match connect_mode.as_str() { "initiator" => { - let mut connection_handler = + let connection_handler = SocketInitiator::try_new(&settings, &app, &store_factory, &log_factory) .expect("Fail to build connection handler"); - server_loop(&mut connection_handler); + server_loop(connection_handler); } "acceptor" => { - let mut connection_handler = + let connection_handler = SocketAcceptor::try_new(&settings, &app, &store_factory, &log_factory) .expect("Fail to build connection handler"); - server_loop(&mut connection_handler); + server_loop(connection_handler); } _ => { eprintln!("Invalid connection mode"); exit(1); } } + + println!(">> All cleared. Bye !"); } -fn server_loop(connection_handler: &mut C) { +fn server_loop(mut connection_handler: C) { println!(">> connection handler START"); connection_handler .start() .expect("Fail to start connection handler"); let mut shell = FixShell::new(); - shell.repl(connection_handler); + shell.repl(&mut connection_handler); println!(">> connection handler STOP"); connection_handler