- Ok(Ok(packet@Packet { t: Answer(..), .. })) =>
- println!("[Client] Command transmitted correctly, answer: {}", packet),
- Ok(Ok(packet)) =>
- println!("[Client] Command transmitted correctly, wrong answer: {}", packet),
- Ok(Err(e)) =>
- println!("[Client] Answer error: {}", e),
- Err(e) =>
- println!("[Client] Can't send the packet. Error: {}", e)
+ Ok(Ok(packet@Packet { t: Answer(..), .. })) => {
+ self.end_point.print("Client", format!("Command transmitted correctly, answer: {}", packet));
+ true
+ },
+ Ok(Ok(packet)) => {
+ self.end_point.print("Client", format!("Command transmitted correctly, wrong answer: {}", packet));
+ false
+ }
+ Ok(Err(e)) => {
+ self.end_point.print("Client", format!("Answer error: {}", e));
+ false
+ }
+ Err(e) => {
+ self.end_point.print("Client", format!("Can't send the packet. Error: {}", e));
+ false
+ }