Skip to content

Commit

Permalink
Improve docs / comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Dec 6, 2021
1 parent cd4db6b commit 11c3e6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/storage-plus/src/indexed_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait IndexList<T> {
}

// TODO: remove traits here and make this const fn new
/// IndexedBucket works like a bucket but has a secondary index
/// `IndexedMap` works like a `Map` but has a secondary index
pub struct IndexedMap<'a, K, T, I>
where
K: PrimaryKey<'a>,
Expand Down Expand Up @@ -574,7 +574,7 @@ mod test {
let count = marias.len();
assert_eq!(2, count);

// Sorted by (descending) pk
// Pks, sorted by (descending) pk
assert_eq!(marias[0].0, b"5629");
assert_eq!(marias[1].0, b"5627");
// Data is correct
Expand Down Expand Up @@ -630,7 +630,7 @@ mod test {
let count = marias.len();
assert_eq!(2, count);

// Sorted by (descending) pk
// Pks, sorted by (descending) pk
assert_eq!(marias[0].0, "5629");
assert_eq!(marias[1].0, "5627");
// Data is correct
Expand Down Expand Up @@ -694,7 +694,7 @@ mod test {
let count = marias.len();
assert_eq!(2, count);

// Pks (sorted by age descending)
// Pks, sorted by (descending) age
assert_eq!(pk1, marias[0].0);
assert_eq!(pk3, marias[1].0);

Expand Down Expand Up @@ -759,7 +759,7 @@ mod test {
let count = marias.len();
assert_eq!(2, count);

// Remaining part (age) of the index keys, plus pks (bytes) (sorted by age descending)
// Pks, sorted by (descending) age
assert_eq!(pk1, marias[0].0);
assert_eq!(pk3, marias[1].0);

Expand Down
2 changes: 1 addition & 1 deletion packages/storage-plus/src/indexed_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::prefix::{namespaced_prefix_range, Bound, Prefix, PrefixBound};
use crate::snapshot::SnapshotMap;
use crate::{IndexList, Path, Strategy};

/// IndexedSnapshotMap works like a SnapshotMap but has a secondary index
/// `IndexedSnapshotMap` works like a `SnapshotMap` but has a secondary index
pub struct IndexedSnapshotMap<'a, K, T, I> {
pk_namespace: &'a [u8],
primary: SnapshotMap<'a, K, T>,
Expand Down

0 comments on commit 11c3e6f

Please sign in to comment.