Before the latest changes at #10830 I could write if port.peek() { match port.try_recv() { ..., now I cannot write equivalent code. One possible solution would be to have a method (let's call it try_opt) that returns an enumeration consisting of either a result or an indication of an empty port or a an indication of a closed port. This solution feels kind of ugly to me though so I'd appreciate suggestions on better solutions.
cc: @alexcrichton