mirror of
				https://github.com/ktims/rs-aggregate.git
				synced 2025-11-03 19:04:02 -08:00 
			
		
		
		
	Use Display trait for printing
This commit is contained in:
		@@ -38,6 +38,17 @@ impl IpBothRange {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					impl Display for IpBothRange {
 | 
				
			||||||
 | 
					    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 | 
				
			||||||
 | 
					        for ip in self {
 | 
				
			||||||
 | 
					            ip.fmt(f)?;
 | 
				
			||||||
 | 
					            writeln!(f)?;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Ok(())
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub struct IpBothRangeIter<'a> {
 | 
					pub struct IpBothRangeIter<'a> {
 | 
				
			||||||
    v4_iter: IpRangeIter<'a, Ipv4Net>,
 | 
					    v4_iter: IpRangeIter<'a, Ipv4Net>,
 | 
				
			||||||
    v6_iter: IpRangeIter<'a, Ipv6Net>,
 | 
					    v6_iter: IpRangeIter<'a, Ipv6Net>,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,9 +117,7 @@ impl App {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        self.simplify_inputs();
 | 
					        self.simplify_inputs();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for net in &self.prefixes {
 | 
					        print!("{}", self.prefixes);
 | 
				
			||||||
            println!("{}", net);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user