File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -271,11 +271,13 @@ impl<'de, S: AsRef<[u8]>> Reader<S> {
271271 /// use ipnetwork::IpNetwork;
272272 /// use maxminddb::{geoip2, Within};
273273 ///
274- /// let ip_net = IpNetwork::V6("::/0");
275- /// let mut iter: Within<geoip2::City, _> = reader.within(ip_net).map_err(|e| e.to_string())?;
274+ /// let reader = maxminddb::Reader::open_readfile("test-data/test-data/GeoIP2-City-Test.mmdb").unwrap();
275+ ///
276+ /// let ip_net = IpNetwork::V6("::/0".parse().unwrap());
277+ /// let mut iter: Within<geoip2::City, _> = reader.within(ip_net).unwrap();
276278 /// while let Some(next) = iter.next() {
277- /// let item = next.map_err(|e| e.to_string())? ;
278- /// println!("ip_net={}, city={:?}", item.ip_net, city)
279+ /// let item = next.unwrap() ;
280+ /// println!("ip_net={}, city={:?}", item.ip_net, item.info);
279281 /// }
280282 /// ```
281283 pub fn within < T > ( & ' de self , cidr : IpNetwork ) -> Result < Within < T , S > , MaxMindDBError >
You can’t perform that action at this time.
0 commit comments