chore: sytle
This commit is contained in:
@@ -13,22 +13,16 @@ fn main() {
|
||||
|
||||
let mut data = [0_u8; 6]; // using 6 byte buffer
|
||||
match stream.read_exact(&mut data) {
|
||||
Ok(_) => {
|
||||
if &data == msg {
|
||||
println!("Reply is ok!");
|
||||
} else {
|
||||
let text = from_utf8(&data).unwrap();
|
||||
println!("Unexpected reply: {}", text);
|
||||
}
|
||||
Ok(_) => if &data == msg {
|
||||
println!("Reply is ok!");
|
||||
} else {
|
||||
let text = from_utf8(&data).unwrap();
|
||||
println!("Unexpected reply: {}", text);
|
||||
},
|
||||
Err(e) => {
|
||||
println!("Failed to receive data: {}", e);
|
||||
}
|
||||
Err(e) => println!("Failed to receive data: {}", e),
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
println!("Failed to connect: {}", e);
|
||||
}
|
||||
Err(e) => println!("Failed to connect: {}", e),
|
||||
}
|
||||
println!("Terminated.");
|
||||
}
|
||||
@@ -31,10 +31,7 @@ fn main() {
|
||||
handle_client(stream)
|
||||
});
|
||||
},
|
||||
Err(e) => {
|
||||
println!("Error: {}", e);
|
||||
/* connection failed */
|
||||
},
|
||||
Err(e) => println!("Error: {}", e),
|
||||
}
|
||||
}
|
||||
// close the socket server
|
||||
|
||||
Reference in New Issue
Block a user