mirror of
https://github.com/ktims/rs-aggregate.git
synced 2024-11-15 23:27:18 -08:00
Use Display trait for printing
This commit is contained in:
parent
5190e83bb3
commit
498c509e70
@ -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> {
|
||||
v4_iter: IpRangeIter<'a, Ipv4Net>,
|
||||
v6_iter: IpRangeIter<'a, Ipv6Net>,
|
||||
|
@ -117,9 +117,7 @@ impl App {
|
||||
|
||||
self.simplify_inputs();
|
||||
|
||||
for net in &self.prefixes {
|
||||
println!("{}", net);
|
||||
}
|
||||
print!("{}", self.prefixes);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user