Skip to content

Commit

Permalink
Simplify IndexedSnapshotMap trait bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Sep 10, 2021
1 parent b5dc528 commit 31f8a84
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/storage-plus/src/indexed_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@ use crate::snapshot_map::SnapshotMap;
use crate::{IndexList, Path, Strategy};

/// IndexedSnapshotMap works like a SnapshotMap but has a secondary index
pub struct IndexedSnapshotMap<'a, K, T, I>
where
K: PrimaryKey<'a>,
T: Serialize + DeserializeOwned + Clone,
I: IndexList<T>,
{
pub struct IndexedSnapshotMap<'a, K, T, I> {
pk_namespace: &'a [u8],
primary: SnapshotMap<'a, K, T>,
/// This is meant to be read directly to get the proper types, like:
/// map.idx.owner.items(...)
pub idx: I,
}

impl<'a, K, T, I> IndexedSnapshotMap<'a, K, T, I>
where
K: PrimaryKey<'a>,
T: Serialize + DeserializeOwned + Clone,
I: IndexList<T>,
{
impl<'a, K, T, I> IndexedSnapshotMap<'a, K, T, I> {
pub fn new(
pk_namespace: &'a str,
checkpoints: &'a str,
Expand Down

0 comments on commit 31f8a84

Please sign in to comment.