self.socket.try_recv().ok()
.and_then(|msg| deserialize(&msg).ok())
.and_then(|decoded| match decoded {
Packet::JoinResult { success } => Some(success),
_ => None,
})
.and_then(|success| {
if success {
undefined!()
} else {
undefined!()
}
None
});


Result가 Error일 때는 계속 무시하고 하고 있으니까 그냥 Option으로 바꿔버리면 Error 타입 관계 없이 and_then으로 쭉쭉 연결하면 될 듯한데?

try_recv가 반환하는 Result나 deserialize가 반환하는 Result는 ok로 Option으로 바꾸고

Packet::JoinResult는 할 수 없이 match한 다음 Option으로 바꾸고 ㅇㅇ