Skip to content

Commit b66b49f

Browse files
committed
Add iterator support to AdvisoryDatabase
1 parent 47ddcd8 commit b66b49f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use advisory::Advisory;
1818
use error::{Error, Result};
1919
use std::collections::HashMap;
2020
use std::collections::hash_map::Entry::{Occupied, Vacant};
21+
use std::collections::hash_map::Iter;
2122
use std::io::Read;
2223
use std::str;
2324

@@ -96,6 +97,11 @@ impl AdvisoryDatabase {
9697

9798
result
9899
}
100+
101+
/// Iterate over all of the advisories in the database
102+
pub fn iter(&self) -> Iter<String, Advisory> {
103+
self.advisories.iter()
104+
}
99105
}
100106

101107
#[cfg(test)]

0 commit comments

Comments
 (0)