These are chat archives for rust-lang/rust

21st
Aug 2016
Romet Tagobert
@amPerl
Aug 21 2016 15:00
Hi!
Anyone have an idea why the compiler suggests this Ok is unreachable?
fn handle_client(mut stream: TcpStream) -> Result<(), io::Error> {
    try!(perform_exchange(&mut stream));
    loop {
        let pkt = try!(read_drift_packet(&mut stream));
        println!("[+] recv packet {}, len: {}", pkt.len, pkt.id);
        println!("payload len: {}", pkt.payload.capacity());
    }
    Ok(())
}
Actually, I'm dumb, I just realised try returns with an error straight away. Never mind :) edit: also that my print args are in reverse
Jarred Nicholls
@jnicholls
Aug 21 2016 15:09
;)
Jonas Platte
@jplatte
Aug 21 2016 15:56
Opened a bug report about my previous question (rust-lang/rust#35870), if anyone has a similar problem. Seems it is actually a bug and I wasn't doing anything wrong.