melib/EnvelopeHashBatch: impl len method

memfd
Manos Pitsidianakis 2020-09-16 13:14:54 +03:00
parent 096c2970b3
commit 92b25de34e
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 5 additions and 1 deletions

View File

@ -609,7 +609,11 @@ impl std::convert::TryFrom<&[EnvelopeHash]> for EnvelopeHashBatch {
} }
impl EnvelopeHashBatch { impl EnvelopeHashBatch {
fn iter(&self) -> impl std::iter::Iterator<Item = EnvelopeHash> + '_ { pub fn iter(&self) -> impl std::iter::Iterator<Item = EnvelopeHash> + '_ {
std::iter::once(self.first).chain(self.rest.iter().cloned()) std::iter::once(self.first).chain(self.rest.iter().cloned())
} }
pub fn len(&self) -> usize {
1 + self.rest.len()
}
} }