mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Impl IntoIterator
for &Records
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
df3af9727e
commit
aba2c87d6d
1 changed files with 12 additions and 2 deletions
|
@ -1,9 +1,9 @@
|
|||
use std::{
|
||||
cmp,
|
||||
collections::BTreeSet,
|
||||
collections::{btree_set, BTreeSet},
|
||||
fs, hash,
|
||||
io::{self, Write},
|
||||
iter::IntoIterator,
|
||||
iter::{IntoIterator, Iterator},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
|
@ -155,3 +155,13 @@ impl Records {
|
|||
write_to(self.file, &mut self.data.into_iter())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a Records {
|
||||
type Item = &'a MetaData;
|
||||
|
||||
type IntoIter = btree_set::Iter<'a, MetaData>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.data.iter()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue