Skip to content

Instantly share code, notes, and snippets.

@nicolas-cherel
Created August 27, 2015 10:01
Show Gist options
  • Save nicolas-cherel/bc1637a4c38f09258ba6 to your computer and use it in GitHub Desktop.
Save nicolas-cherel/bc1637a4c38f09258ba6 to your computer and use it in GitHub Desktop.
should result something like [V6([2a00:1450:4007:807::1012]:80), V6([2a00:1450:4007:807::1012]:80), V4(216.58.208.228:80), V4(216.58.208.228:80)]
rustc -o /tmp/p /dev/stdin <<CODE && /tmp/p
fn main() {
use std::net::ToSocketAddrs;
println!("{:?}", "www.google.com:80".to_socket_addrs().map(|a| a.into_iter().collect::<Vec<_>>()).unwrap())
}
CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment