projects
/
crypto_lab1.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test the new syntax 'if let'.
[crypto_lab1.git]
/
lab1_rust
/
src
/
end_point.rs
diff --git
a/lab1_rust/src/end_point.rs
b/lab1_rust/src/end_point.rs
index
f69f78e
..
97104c6
100644
(file)
--- a/
lab1_rust/src/end_point.rs
+++ b/
lab1_rust/src/end_point.rs
@@
-299,10
+299,9
@@
impl EndPoint {
fn read(&mut self) -> ReadingResult {
fn send_error(ep: &mut EndPoint, error_type: packet::ErrorType) {
fn read(&mut self) -> ReadingResult {
fn send_error(ep: &mut EndPoint, error_type: packet::ErrorType) {
- match ep.send(Error(error_type)) {
- Err(e) => println!("Unable to send error packet: {}", e),
- Ok(_) => ()
- };
+ if let Err(e) = ep.send(Error(error_type)) {
+ println!("Unable to send error packet: {}", e)
+ }
};
self.socket.set_timeout(DEFAULT_TIMEOUT);
};
self.socket.set_timeout(DEFAULT_TIMEOUT);