From 65ca3f3450d0067668111f6e13cc3089768c9efe Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 5 Feb 2026 20:31:55 +0100 Subject: remove read/write distinction for kv transactions; traitify database --- database/src/prefix_iterator.rs | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 database/src/prefix_iterator.rs (limited to 'database/src/prefix_iterator.rs') diff --git a/database/src/prefix_iterator.rs b/database/src/prefix_iterator.rs deleted file mode 100644 index 9a73558..0000000 --- a/database/src/prefix_iterator.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* - This file is part of jellything (https://codeberg.org/metamuffin/jellything) - which is licensed under the GNU Affero General Public License (version 3); see /COPYING. - Copyright (C) 2026 metamuffin -*/ - -use anyhow::Result; -use std::borrow::Cow; - -pub struct PrefixIterator<'a> { - pub inner: Box>> + 'a>, - pub prefix: Cow<'a, [u8]>, -} -impl Iterator for PrefixIterator<'_> { - type Item = Result>; - fn next(&mut self) -> Option { - self.inner.next().filter(|k| match k { - Ok(v) => v.starts_with(&self.prefix), - Err(_) => true, - }) - } -} -- cgit v1.3