Re:Announcing Tokio 0.1
by carllerche on Wednesday January 11, 2017 @01:06PM
(#13375969)
Rust uses type inference to figure that out. Because `addr` gets passed to `TcpListener::bind` which requires a `SocketAddr`, the type inferencer knows that `addr` should be a SocketAddr and so it all works :)
[ Parent
| on HN ]
You might also add that it only works because SocketAddr implements FromStr. Type inference will only determine which version of from_str to call, it won't actually do the parsing.