use fqdn::FQDN; use fqdn_trie::*; fn main() { let www = [ "c.footprint.net", "lds.rncdn7.com", "sds.rncdn7.com", ]; let trie = www.iter() .map(|s| s.parse::()) .collect::,_>>() .unwrap(); trie.open_dot_view().expect("can’t open dot view"); let fqdn = FQDN::default(); //let fqdn = fqdn::fqdn!("a.c.footprint.net"); println!("{} -> {}", &fqdn, trie.lookup(&fqdn)); }