Less naked while loop to print error on deser fail
Co-Authored-By: twistedddx <bits@live.com>
This commit is contained in:
1 parent
6396883a26
commit
cecb29b46f
1 file changed
+4
-7
@@ -55,15 +55,12 @@ impl BcConnection {
|
||||
|
||||
let rx_thread = std::thread::spawn(move || {
|
||||
let mut context = BcContext::new();
|
||||
let mut result;
|
||||
while {
|
||||
match BcConnection::poll(&mut context, &conn, &mut subs) {
|
||||
Ok(_) => true,
|
||||
Err(err) => {
|
||||
error!("Deserialization error: {:?}", err);
|
||||
false
|
||||
}
|
||||
}
|
||||
result = BcConnection::poll(&mut context, &conn, &mut subs);
|
||||
result.is_ok()
|
||||
} {}
|
||||
error!("Deserialization error: {:?}", result.unwrap_err());
|
||||
});
|
||||
|
||||
Ok(BcConnection {
|
||||
|
||||
Reference in new issue
Block a user