chore: sytle

This commit is contained in:
2020-08-30 00:37:28 +08:00
parent e8dc9a49fb
commit 9eaaa185ca
2 changed files with 8 additions and 17 deletions

View File

@@ -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 {
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.");
}

View File

@@ -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