*: implement ExactSizeIterator where possible

This commit is contained in:
meh
2015-08-25 16:13:42 +02:00
parent 62acd3ef02
commit b839b5fe2f
5 changed files with 48 additions and 0 deletions

View File

@ -66,4 +66,12 @@ impl<'a> Iterator for DeviceIter<'a> {
}
}
}
fn size_hint(&self) -> (usize, Option<usize>) {
unsafe {
((*self.ptr).nb_devices as usize, Some((*self.ptr).nb_devices as usize))
}
}
}
impl<'a> ExactSizeIterator for DeviceIter<'a> { }