btpeer 0.11.0

Simple CLI tool and library to get peers from TCP/HTTP and UDP BitTorrent trackers
Documentation
use std::net::IpAddr;

#[derive(Debug)]
pub struct Default {
    pub host: IpAddr,
    pub port: u16,
}

impl std::fmt::Display for Default {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}:{}",
            if self.host.is_ipv6() {
                format!("[{}]", self.host)
            } else {
                self.host.to_string()
            },
            self.port
        )
    }
}