impl FusedIterator for IpSubnets and related

This commit is contained in:
Tyler Ruckinger
2019-10-28 18:36:00 -04:00
parent 033c4a1311
commit 0541fb9956
+5
View File
@@ -3,6 +3,7 @@ use std::cmp::Ordering::{Less, Equal};
use std::convert::From;
use std::error::Error;
use std::fmt;
use std::iter::FusedIterator;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::option::Option::{Some, None};
@@ -1445,6 +1446,10 @@ impl Iterator for Ipv6Subnets {
}
}
impl FusedIterator for IpSubnets {}
impl FusedIterator for Ipv4Subnets {}
impl FusedIterator for Ipv6Subnets {}
// Generic function for merging a vector of intervals.
fn merge_intervals<T: Copy + Ord>(mut intervals: Vec<(T, T)>) -> Vec<(T, T)> {
if intervals.len() == 0 {