Skip to content

Commit

Permalink
Add keys() shortcut for simple keys to IndexedMap
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Jul 22, 2021
1 parent acd2c93 commit 837798f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/storage-plus/src/indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ where
self.sub_prefix(K::SubPrefix::new())
.range(store, min, max, order)
}

pub fn keys<'c>(
&'c self,
store: &'c dyn Storage,
min: Option<Bound>,
max: Option<Bound>,
order: Order,
) -> Box<dyn Iterator<Item = Vec<u8>> + 'c> {
self.sub_prefix(K::SubPrefix::new())
.keys(store, min, max, order)
}
}

#[derive(Deserialize, Serialize)]
Expand Down

0 comments on commit 837798f

Please sign in to comment.