Repository: cberner/redb
Pull request #539 (2023-03-26 16:05:41)

Various minor cleanups


Patch:
diff --git a/benches/common.rs b/benches/common.rs
index de8f37d..cf35144 100644
--- a/benches/common.rs
+++ b/benches/common.rs
@@ -135,7 +135,7 @@ impl<'txn> BenchReader for RedbBenchReader<'txn> {
 }
 
 pub struct RedbBenchIterator<'a> {
-    iter: redb::RangeIter<'a, &'static [u8], &'static [u8]>,
+    iter: redb::Range<'a, &'static [u8], &'static [u8]>,
 }
 
 impl BenchIterator for RedbBenchIterator<'_> {
diff --git a/fuzz/fuzz_targets/fuzz_redb.rs b/fuzz/fuzz_targets/fuzz_redb.rs
index 5a7cefb..890cea8 100644
--- a/fuzz/fuzz_targets/fuzz_redb.rs
+++ b/fuzz/fuzz_targets/fuzz_redb.rs
@@ -1,7 +1,7 @@
 #![no_main]
 
 use libfuzzer_sys::fuzz_target;
-use redb::{AccessGuard, Database, Durability, Error, MultimapTableDefinition, MultimapValueIter, ReadableMultimapTable, ReadableTable, TableDefinition, WriteStrategy};
+use redb::{AccessGuard, Database, Durability, Error, MultimapTableDefinition, MultimapValue, ReadableMultimapTable, ReadableTable, TableDefinition, WriteStrategy};
 use std::collections::{BTreeMap, BTreeSet};
 use std::sync::{Arc, Mutex};
 use std::thread;
@@ -141,7 +141,7 @@ fn exec_table_inner(db: Arc<Database>, transactions: &[FuzzTransaction], referen
 }
 
 fn assert_multimap_value_eq(
-    mut iter: MultimapValueIter<&[u8]>,
+    mut iter: MultimapValue<&[u8]>,
     reference: Option<&BTreeSet<usize>>,
 ) {
     if let Some(values) = reference {
@@ -250,7 +250,7 @@ fn exec_multimap_table_inner(db: Arc<Database>, transactions: &[FuzzTransaction]
                             } else {
                                 Box::new(local_reference.range(start..end))
                             };
-                        let mut iter: Box<dyn Iterator<Item = (AccessGuard<u64>, MultimapValueIter<&[u8]>)>> = if *reversed {
+                        let mut iter: Box<dyn Iterator<Item = (AccessGuard<u64>, MultimapValue<&[u8]>)>> = if *reversed {
                             Box::new(table.range(start..end).unwrap().rev())
                         } else {
                             Box::new(table.range(start..end).unwrap())
diff --git a/src/lib.rs b/src/lib.rs
index 7ee27f3..9539858 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,17 +6,14 @@
     clippy::cast_sign_loss
 )]
 
-extern crate core;
-
 pub use db::{Builder, Database, MultimapTableDefinition, TableDefinition, WriteStrategy};
 pub use error::Error;
 pub use multimap_table::{
-    MultimapRangeIter, MultimapTable, MultimapValueIter, ReadOnlyMultimapTable,
-    ReadableMultimapTable,
+    MultimapRange, MultimapTable, MultimapValue, ReadOnlyMultimapTable, ReadableMultimapTable,
 };
-pub use table::{RangeIter, ReadOnlyTable, ReadableTable, Table};
+pub use table::{Drain, DrainFilter, Range, ReadOnlyTable, ReadableTable, Table};
 pub use transactions::{DatabaseStats, Durability, ReadTransaction, WriteTransaction};
-pub use tree_store::{AccessGuard, Savepoint};
+pub use tree_store::{AccessGuard, AccessGuardMut, Savepoint};
 pub use types::{RedbKey, RedbValue, TypeName};
 
 type Result<T = (), E = Error> = std::result::Result<T, E>;
diff --git a/src/multimap_table.rs b/src/multimap_table.rs
index 199ea1a..092a42f 100644
--- a/src/multimap_table.rs
+++ b/src/multimap_table.rs
@@ -201,7 +201,7 @@ impl DynamicCollection {
     fn iter<'a, V: RedbKey>(
         collection: AccessGuard<'a, &'static DynamicCollection>,
         mem: &'a TransactionalMemory,
-    ) -> Result<MultimapValueIter<'a, V>> {
+    ) -> Result<MultimapValue<'a, V>> {
         Ok(match collection.value().collection_type() {
             Inline => {
                 let leaf_iter = LeafKeyIter::new(
@@ -209,11 +209,11 @@ impl DynamicCollection {
                     V::fixed_width(),
                     <() as RedbValue>::fixed_width(),
                 );
-                MultimapValueIter::new_inline(leaf_iter)
+                MultimapValue::new_inline(leaf_iter)
             }
             Subtree => {
                 let root = collection.value().as_subtree().0;
-                MultimapValueIter::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
+                MultimapValue::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
                     ..,
                     Some(root),
                     mem,
@@ -227,7 +227,7 @@ impl DynamicCollection {
         pages: Vec<PageNumber>,
         freed_pages: Arc<Mutex<Vec<PageNumber>>>,
         mem: &'a TransactionalMemory,
-    ) -> Result<MultimapValueIter<'a, V>> {
+    ) -> Result<MultimapValue<'a, V>> {
         Ok(match collection.value().collection_type() {
             Inline => {
                 let leaf_iter = LeafKeyIter::new(
@@ -235,13 +235,13 @@ impl DynamicCollection {
                     V::fixed_width(),
                     <() as RedbValue>::fixed_width(),
                 );
-                MultimapValueIter::new_inline(leaf_iter)
+                MultimapValue::new_inline(leaf_iter)
             }
             Subtree => {
                 let root = collection.value().as_subtree().0;
                 let inner =
                     BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(.., Some(root), mem)?;
-                MultimapValueIter::new_subtree_free_on_drop(inner, freed_pages, pages, mem)
+                MultimapValue::new_subtree_free_on_drop(inner, freed_pages, pages, mem)
             }
         })
     }
@@ -267,7 +267,7 @@ enum ValueIterState<'a, V: RedbKey + 'static> {
     InlineLeaf(LeafKeyIter<'a>),
 }
 
-pub struct MultimapValueIter<'a, V: RedbKey + 'static> {
+pub struct MultimapValue<'a, V: RedbKey + 'static> {
     inner: Option<ValueIterState<'a, V>>,
     freed_pages: Option<Arc<Mutex<Vec<PageNumber>>>>,
     free_on_drop: Vec<PageNumber>,
@@ -275,7 +275,7 @@ pub struct MultimapValueIter<'a, V: RedbKey + 'static> {
     _value_type: PhantomData<V>,
 }
 
-impl<'a, V: RedbKey + 'static> MultimapValueIter<'a, V> {
+impl<'a, V: RedbKey + 'static> MultimapValue<'a, V> {
     fn new_subtree(inner: BtreeRangeIter<'a, V, ()>) -> Self {
         Self {
             inner: Some(ValueIterState::Subtree(inner)),
@@ -312,7 +312,8 @@ impl<'a, V: RedbKey + 'static> MultimapValueIter<'a, V> {
     }
 }
 
-impl<'a, V: RedbKey + 'static> Iterator for MultimapValueIter<'a, V> {
+impl<'a, V: RedbKey + 'static> Iterator for MultimapValue<'a, V> {
+    // TODO: this probably needs to return a Result
     type Item = AccessGuard<'a, V>;
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -325,7 +326,7 @@ impl<'a, V: RedbKey + 'static> Iterator for MultimapValueIter<'a, V> {
     }
 }
 
-impl<'a, V: RedbKey + 'static> DoubleEndedIterator for MultimapValueIter<'a, V> {
+impl<'a, V: RedbKey + 'static> DoubleEndedIterator for MultimapValue<'a, V> {
     fn next_back(&mut self) -> Option<Self::Item> {
         // TODO: optimize out this copy
         let bytes = match self.inner.as_mut().unwrap() {
@@ -336,7 +337,7 @@ impl<'a, V: RedbKey + 'static> DoubleEndedIterator for MultimapValueIter<'a, V>
     }
 }
 
-impl<'a, V: RedbKey + 'static> Drop for MultimapValueIter<'a, V> {
+impl<'a, V: RedbKey + 'static> Drop for MultimapValue<'a, V> {
     fn drop(&mut self) {
         // Drop our references to the pages that are about to be freed
         drop(mem::take(&mut self.inner));
@@ -351,14 +352,14 @@ impl<'a, V: RedbKey + 'static> Drop for MultimapValueIter<'a, V> {
     }
 }
 
-pub struct MultimapRangeIter<'a, K: RedbKey + 'static, V: RedbKey + 'static> {
+pub struct MultimapRange<'a, K: RedbKey + 'static, V: RedbKey + 'static> {
     inner: BtreeRangeIter<'a, K, &'static DynamicCollection>,
     mem: &'a TransactionalMemory,
     _key_type: PhantomData<K>,
     _value_type: PhantomData<V>,
 }
 
-impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> MultimapRangeIter<'a, K, V> {
+impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> MultimapRange<'a, K, V> {
     fn new(
         inner: BtreeRangeIter<'a, K, &'static DynamicCollection>,
         mem: &'a TransactionalMemory,
@@ -372,8 +373,9 @@ impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> MultimapRangeIter<'a, K, V>
     }
 }
 
-impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> Iterator for MultimapRangeIter<'a, K, V> {
-    type Item = (AccessGuard<'a, K>, MultimapValueIter<'a, V>);
+impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> Iterator for MultimapRange<'a, K, V> {
+    // TODO: this probably needs to return a Result
+    type Item = (AccessGuard<'a, K>, MultimapValue<'a, V>);
 
     fn next(&mut self) -> Option<Self::Item> {
         let entry = self.inner.next()?;
@@ -388,7 +390,7 @@ impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> Iterator for MultimapRangeI
 }
 
 impl<'a, K: RedbKey + 'static, V: RedbKey + 'static> DoubleEndedIterator
-    for MultimapRangeIter<'a, K, V>
+    for MultimapRange<'a, K, V>
 {
     fn next_back(&mut self) -> Option<Self::Item> {
         let entry = self.inner.next_back()?;
@@ -700,10 +702,7 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbKey + 'static> MultimapTable<'db, '
     /// Removes all values for the given key
     ///
     /// Returns an iterator over the removed values. Values are in ascending order.
-    pub fn remove_all<'a>(
-        &mut self,
-        key: impl Borrow<K::SelfType<'a>>,
-    ) -> Result<MultimapValueIter<V>>
+    pub fn remove_all<'a>(&mut self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValue<V>>
     where
         K: 'a,
     {
@@ -735,7 +734,7 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbKey + 'static> MultimapTable<'db, '
                 self.mem,
             )?
         } else {
-            MultimapValueIter::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
+            MultimapValue::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
                 ..,
                 None,
                 self.mem,
@@ -750,11 +749,11 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbKey + 'static> ReadableMultimapTabl
     for MultimapTable<'db, 'txn, K, V>
 {
     /// Returns an iterator over all values for the given key. Values are in ascending order.
-    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValueIter<'a, V>> {
+    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValue<'a, V>> {
         let iter = if let Some(collection) = self.tree.get(key.borrow())? {
             DynamicCollection::iter(collection, self.mem)?
         } else {
-            MultimapValueIter::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
+            MultimapValue::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
                 ..,
                 None,
                 self.mem,
@@ -768,13 +767,13 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbKey + 'static> ReadableMultimapTabl
     fn range<'a: 'b, 'b, KR>(
         &'a self,
         range: impl RangeBounds<KR> + 'b,
-    ) -> Result<MultimapRangeIter<'a, K, V>>
+    ) -> Result<MultimapRange<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b,
     {
         let inner = self.tree.range(range)?;
-        Ok(MultimapRangeIter::new(inner, self.mem))
+        Ok(MultimapRange::new(inner, self.mem))
     }
 
     /// Returns the number of key-value pairs in the table
@@ -804,14 +803,14 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbKey + 'static> Drop
 
 pub trait ReadableMultimapTable<K: RedbKey + 'static, V: RedbKey + 'static> {
     /// Returns an iterator over all values for the given key. Values are in ascending order.
-    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValueIter<'a, V>>
+    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValue<'a, V>>
     where
         K: 'a;
 
     fn range<'a: 'b, 'b, KR>(
         &'a self,
         range: impl RangeBounds<KR> + 'b,
-    ) -> Result<MultimapRangeIter<'a, K, V>>
+    ) -> Result<MultimapRange<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b;
@@ -822,7 +821,7 @@ pub trait ReadableMultimapTable<K: RedbKey + 'static, V: RedbKey + 'static> {
 
     /// Returns an double-ended iterator over all elements in the table. Values are in ascending
     /// order.
-    fn iter(&self) -> Result<MultimapRangeIter<K, V>> {
+    fn iter(&self) -> Result<MultimapRange<K, V>> {
         self.range::<K::SelfType<'_>>(..)
     }
 }
@@ -852,11 +851,11 @@ impl<'txn, K: RedbKey + 'static, V: RedbKey + 'static> ReadableMultimapTable<K,
     for ReadOnlyMultimapTable<'txn, K, V>
 {
     /// Returns an iterator over all values for the given key. Values are in ascending order.
-    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValueIter<'a, V>> {
+    fn get<'a>(&'a self, key: impl Borrow<K::SelfType<'a>>) -> Result<MultimapValue<'a, V>> {
         let iter = if let Some(collection) = self.tree.get(key.borrow())? {
             DynamicCollection::iter(collection, self.mem)?
         } else {
-            MultimapValueIter::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
+            MultimapValue::new_subtree(BtreeRangeIter::new::<RangeFull, &V::SelfType<'_>>(
                 ..,
                 None,
                 self.mem,
@@ -869,13 +868,13 @@ impl<'txn, K: RedbKey + 'static, V: RedbKey + 'static> ReadableMultimapTable<K,
     fn range<'a: 'b, 'b, KR>(
         &'a self,
         range: impl RangeBounds<KR> + 'b,
-    ) -> Result<MultimapRangeIter<'a, K, V>>
+    ) -> Result<MultimapRange<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b,
     {
         let inner = self.tree.range(range)?;
-        Ok(MultimapRangeIter::new(inner, self.mem))
+        Ok(MultimapRange::new(inner, self.mem))
     }
 
     fn len(&self) -> Result<usize> {
diff --git a/src/table.rs b/src/table.rs
index d55d1f5..275d707 100644
--- a/src/table.rs
+++ b/src/table.rs
@@ -151,15 +151,12 @@ impl<'db, 'txn, K: RedbKey + 'static, V: RedbValue + 'static> ReadableTable<K, V
         self.tree.get(key.borrow())
     }
 
-    fn range<'a: 'b, 'b, KR>(
-        &'a self,
-        range: impl RangeBounds<KR> + 'b,
-    ) -> Result<RangeIter<'a, K, V>>
+    fn range<'a: 'b, 'b, KR>(&'a self, range: impl RangeBounds<KR> + 'b) -> Result<Range<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b,
     {
-        self.tree.range(range).map(RangeIter::new)
+        self.tree.range(range).map(Range::new)
     }
 
     fn len(&self) -> Result<usize> {
@@ -215,10 +212,7 @@ pub trait ReadableTable<K: RedbKey + 'static, V: RedbValue + 'static> {
     /// # Ok(())
     /// # }
     /// ```
-    fn range<'a: 'b, 'b, KR>(
-        &'a self,
-        range: impl RangeBounds<KR> + 'b,
-    ) -> Result<RangeIter<'a, K, V>>
+    fn range<'a: 'b, 'b, KR>(&'a self, range: impl RangeBounds<KR> + 'b) -> Result<Range<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b;
@@ -230,7 +224,7 @@ pub trait ReadableTable<K: RedbKey + 'static, V: RedbValue + 'static> {
     fn is_empty(&self) -> Result<bool>;
 
     /// Returns a double-ended iterator over all elements in the table
-    fn iter(&self) -> Result<RangeIter<K, V>> {
+    fn iter(&self) -> Result<Range<K, V>> {
         self.range::<K::SelfType<'_>>(..)
     }
 }
@@ -262,15 +256,12 @@ impl<'txn, K: RedbKey + 'static, V: RedbValue + 'static> ReadableTable<K, V>
         self.tree.get(key.borrow())
     }
 
-    fn range<'a: 'b, 'b, KR>(
-        &'a self,
-        range: impl RangeBounds<KR> + 'b,
-    ) -> Result<RangeIter<'a, K, V>>
+    fn range<'a: 'b, 'b, KR>(&'a self, range: impl RangeBounds<KR> + 'b) -> Result<Range<'a, K, V>>
     where
         K: 'a,
         KR: Borrow<K::SelfType<'b>> + 'b,
     {
-        self.tree.range(range).map(RangeIter::new)
+        self.tree.range(range).map(Range::new)
     }
 
     fn len(&self) -> Result<usize> {
@@ -293,6 +284,7 @@ impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Drain<'a, K, V> {
 }
 
 impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Iterator for Drain<'a, K, V> {
+    // TODO: probably needs to be a Result
     type Item = (AccessGuard<'a, K>, AccessGuard<'a, V>);
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -342,6 +334,7 @@ impl<
         F: for<'f> FnMut(K::SelfType<'f>, V::SelfType<'f>) -> bool,
     > Iterator for DrainFilter<'a, K, V, F>
 {
+    // TODO: probably needs to be a Result
     type Item = (AccessGuard<'a, K>, AccessGuard<'a, V>);
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -369,17 +362,18 @@ impl<
     }
 }
 
-pub struct RangeIter<'a, K: RedbKey + 'static, V: RedbValue + 'static> {
+pub struct Range<'a, K: RedbKey + 'static, V: RedbValue + 'static> {
     inner: BtreeRangeIter<'a, K, V>,
 }
 
-impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> RangeIter<'a, K, V> {
+impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Range<'a, K, V> {
     fn new(inner: BtreeRangeIter<'a, K, V>) -> Self {
         Self { inner }
     }
 }
 
-impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Iterator for RangeIter<'a, K, V> {
+impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Iterator for Range<'a, K, V> {
+    // TODO: this probably needs to return a Result
     type Item = (AccessGuard<'a, K>, AccessGuard<'a, V>);
 
     fn next(&mut self) -> Option<Self::Item> {
@@ -394,7 +388,7 @@ impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> Iterator for RangeIter<'a
     }
 }
 
-impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> DoubleEndedIterator for RangeIter<'a, K, V> {
+impl<'a, K: RedbKey + 'static, V: RedbValue + 'static> DoubleEndedIterator for Range<'a, K, V> {
     fn next_back(&mut self) -> Option<Self::Item> {
         if let Some(entry) = self.inner.next_back() {
             let (page, key_range, value_range) = entry.into_raw();
diff --git a/src/tree_store/mod.rs b/src/tree_store/mod.rs
index cb046a8..8eb3d80 100644
--- a/src/tree_store/mod.rs
+++ b/src/tree_store/mod.rs
@@ -6,9 +6,8 @@ mod page_store;
 mod table_tree;
 
 pub(crate) use btree::{Btree, BtreeMut, RawBtree};
-pub use btree_base::AccessGuard;
-pub(crate) use btree_base::AccessGuardMut;
 pub(crate) use btree_base::Checksum;
+pub use btree_base::{AccessGuard, AccessGuardMut};
 pub(crate) use btree_base::{LeafAccessor, RawLeafBuilder, BRANCH, LEAF};
 pub(crate) use btree_iters::{
     AllPageNumbersBtreeIter, BtreeDrain, BtreeDrainFilter, BtreeRangeIter,


Test patch:
diff --git a/tests/basic_tests.rs b/tests/basic_tests.rs
index 1300a0a..2a5fbe6 100644
--- a/tests/basic_tests.rs
+++ b/tests/basic_tests.rs
@@ -1,6 +1,6 @@
 use redb::{
-    Database, MultimapTableDefinition, RangeIter, ReadableTable, RedbKey, RedbValue,
-    TableDefinition, TypeName,
+    Database, MultimapTableDefinition, Range, ReadableTable, RedbKey, RedbValue, TableDefinition,
+    TypeName,
 };
 use std::cmp::Ordering;
 use std::sync;
@@ -876,7 +876,7 @@ fn i128_type() {
     let read_txn = db.begin_read().unwrap();
     let table = read_txn.open_table(definition).unwrap();
     assert_eq!(-2, table.get(&-1).unwrap().unwrap().value());
-    let mut iter: RangeIter<i128, i128> = table.range::<i128>(..).unwrap();
+    let mut iter: Range<i128, i128> = table.range::<i128>(..).unwrap();
     for i in -11..10 {
         assert_eq!(iter.next().unwrap().1.value(), i);
     }
@@ -924,7 +924,7 @@ fn str_type() {
     assert_eq!(iter.next().unwrap().1.value(), "world");
     assert!(iter.next().is_none());
 
-    let mut iter: RangeIter<&str, &str> = table.range("a".."z").unwrap();
+    let mut iter: Range<&str, &str> = table.range("a".."z").unwrap();
     assert_eq!(iter.next().unwrap().1.value(), "world");
     assert!(iter.next().is_none());
 }
@@ -988,7 +988,7 @@ fn array_type() {
     let hello = b"hello";
     assert_eq!(b"world_123", table.get(hello).unwrap().unwrap().value());
 
-    let mut iter: RangeIter<&[u8; 5], &[u8; 9]> = table.range::<&[u8; 5]>(..).unwrap();
+    let mut iter: Range<&[u8; 5], &[u8; 9]> = table.range::<&[u8; 5]>(..).unwrap();
     assert_eq!(iter.next().unwrap().1.value(), b"world_123");
     assert!(iter.next().is_none());
 }
@@ -1159,12 +1159,12 @@ fn owned_get_signatures() {
 
     assert_eq!(2, table.get(&1).unwrap().unwrap().value());
 
-    let mut iter: RangeIter<u32, u32> = table.range::<u32>(..).unwrap();
+    let mut iter: Range<u32, u32> = table.range::<u32>(..).unwrap();
     for i in 0..10 {
         assert_eq!(iter.next().unwrap().1.value(), i + 1);
     }
     assert!(iter.next().is_none());
-    let mut iter: RangeIter<u32, u32> = table.range(0..10).unwrap();
+    let mut iter: Range<u32, u32> = table.range(0..10).unwrap();
     for i in 0..10 {
         assert_eq!(iter.next().unwrap().1.value(), i + 1);
     }