@@ -103,7 +103,6 @@ impl<'de, T: Deserialize<'de>, S: AsRef<[u8]>> Iterator for Within<'de, T, S> {
103103 fn next ( & mut self ) -> Option < Self :: Item > {
104104 while !self . stack . is_empty ( ) {
105105 let current = self . stack . pop ( ) . unwrap ( ) ;
106- //println!(" current={:#?}", current);
107106 let bit_count = current. ip_bytes . len ( ) * 8 ;
108107
109108 if current. node > self . node_count {
@@ -113,7 +112,6 @@ impl<'de, T: Deserialize<'de>, S: AsRef<[u8]>> Iterator for Within<'de, T, S> {
113112 Ok ( ip_net) => ip_net,
114113 Err ( e) => return Some ( Err ( e) ) ,
115114 } ;
116- //println!(" emit: current={:#?}, net={}", current, net);
117115 // TODO: should this block become a helper method on reader?
118116 let rec = match self . reader . resolve_data_pointer ( current. node ) {
119117 Ok ( rec) => rec,
@@ -284,31 +282,21 @@ impl<'de, S: AsRef<[u8]>> Reader<S> {
284282 where
285283 T : Deserialize < ' de > ,
286284 {
287- //println!("within: cidr={}", cidr);
288285 let ip_address = cidr. network ( ) ;
289- //println!(" ip_address={}", ip_address);
290286 let prefix_len = cidr. prefix ( ) as usize ;
291- //println!(" prefix={}", prefix_len);
292287 let ip_bytes = ip_to_bytes ( ip_address) ;
293- //println!(" ip_bytes={:#?}", ip_bytes);
294288 let bit_count = ip_bytes. len ( ) * 8 ;
295- //println!(" bit_count={:#?}", bit_count);
296289
297290 let mut node = self . start_node ( bit_count) ;
298- //println!(" node={}", node);
299291 let node_count = self . metadata . node_count as usize ;
300- //println!(" node_count={}", node_count);
301292
302293 let mut stack: Vec < WithinNode > = Vec :: with_capacity ( bit_count - prefix_len) ;
303294
304295 // Traverse down the tree to the level that matches the cidr mark
305296 let mut i = 0_usize ;
306297 while i < prefix_len {
307- //println!(" i={}", i);
308298 let bit = 1 & ( ip_bytes[ i >> 3 ] >> 7 - ( i % 8 ) ) as usize ;
309- //println!(" bit={}", bit);
310299 node = self . read_node ( node, bit) ?;
311- //println!(" node={}", node);
312300 if node >= node_count {
313301 // We've hit a dead end before we exhausted our prefix
314302 break ;
@@ -329,7 +317,6 @@ impl<'de, S: AsRef<[u8]>> Reader<S> {
329317 // else the stack will be empty and we'll be returning an iterator that visits nothing,
330318 // which makes sense.
331319
332- //println!(" stack={:#?}", stack);
333320 let within: Within < T , S > = Within {
334321 reader : self ,
335322 node_count,
0 commit comments