summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-04-13 22:16:32 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-04-14 00:16:47 +0200
commit1f515b1d0d1e2b32384ead5f5081db81451bd4f7 (patch)
treeb798f132b524d224a7459a99ef97988f0aac92db
parent0283c3af7a0d15b4b0b79c01d65c2827b0936515 (diff)
downloadimag-1f515b1d0d1e2b32384ead5f5081db81451bd4f7.zip
imag-1f515b1d0d1e2b32384ead5f5081db81451bd4f7.tar.gz
Remove DeleteUnlinkedIter
Because the code is not used. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/entry/libimagentrylink/src/internal.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/entry/libimagentrylink/src/internal.rs b/lib/entry/libimagentrylink/src/internal.rs
index 89f4455..0a22ee1 100644
--- a/lib/entry/libimagentrylink/src/internal.rs
+++ b/lib/entry/libimagentrylink/src/internal.rs
@@ -237,12 +237,6 @@ pub mod iter {
GetIter(i, store)
}
- /// Turn this iterator into a LinkGcIter, which `Store::delete()`s entries that are not
- /// linked to any other entry.
- pub fn delete_unlinked(self) -> DeleteUnlinkedIter<'a> {
- DeleteUnlinkedIter(self)
- }
-
/// Turn this iterator into a FilterLinksIter that removes all entries that are not linked
/// to any other entry, by filtering them out the iterator.
///
@@ -333,48 +327,6 @@ pub mod iter {
}
- /// An iterator that removes all Items from the iterator that are not linked anymore by calling
- /// `Store::delete()` on them.
- ///
- /// It yields only items which are somehow linked to another entry
- ///
- /// # Warning
- ///
- /// Deletes entries from the store.
- ///
- pub struct DeleteUnlinkedIter<'a>(GetIter<'a>);
-
- impl<'a> Iterator for DeleteUnlinkedIter<'a> {
- type Item = Result<FileLockEntry<'a>>;
-
- fn next(&mut self) -> Option<Self::Item> {
- use internal::InternalLinker;
-
- loop {
- match self.0.next() {
- Some(Ok(fle)) => {
- let links = match fle.get_internal_links() {
- Err(e) => return Some(Err(e)),
- Ok(links) => links,
- };
- if links.count() == 0 {
- match self.0.store().delete(fle.get_location().clone()) {
- Ok(x) => x,
- Err(e) => return Some(Err(e).map_err(From::from)),
- }
- } else {
- return Some(Ok(fle));
- }
- },
- Some(Err(e)) => return Some(Err(e)),
- None => break,
- }
- }
- None
- }
-
- }
-
}
impl InternalLinker for Entry {