Type annotation on match pattern

You can do it in the pattern like this:

    match listener.accept() {
        Ok::<(TcpStream, SocketAddr), _>((_socket,  addr)) => {

Playground

5 Likes