Skip to content

Commit

Permalink
Update rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerfiliba committed Sep 8, 2024
1 parent 27c9750 commit b4db947
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions src/lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,12 @@ impl CandyStore {
/// will need to skip these holes. If you remove elements from the middle (not head/tail) of the list
/// frequently, and wish to use iteration, consider compacting the list every so often using
/// [Self::compact_list_if_needed]
pub fn iter_list<'a, B: AsRef<[u8]> + ?Sized>(&'a self, list_key: &B) -> ListIterator {
pub fn iter_list<B: AsRef<[u8]> + ?Sized>(&self, list_key: &B) -> ListIterator {
self.owned_iter_list(list_key.as_ref().to_owned())
}

/// Owned version of [Self::iter_list]
pub fn owned_iter_list<'a>(&'a self, list_key: Vec<u8>) -> ListIterator {
pub fn owned_iter_list(&self, list_key: Vec<u8>) -> ListIterator {
let (list_ph, list_key) = self.make_list_key(list_key);
ListIterator {
store: &self,
Expand All @@ -648,15 +648,12 @@ impl CandyStore {
}

/// Same as [Self::iter_list] but iterates from the end (tail) to the beginning (head)
pub fn iter_list_backwards<'a, B: AsRef<[u8]> + ?Sized>(
&'a self,
list_key: &B,
) -> ListIterator {
pub fn iter_list_backwards<B: AsRef<[u8]> + ?Sized>(&self, list_key: &B) -> ListIterator {
self.owned_iter_list_backwards(list_key.as_ref().to_owned())
}

/// Owned version of [Self::iter_list_backwards]
pub fn owned_iter_list_backwards<'a>(&'a self, list_key: Vec<u8>) -> ListIterator {
pub fn owned_iter_list_backwards(&self, list_key: Vec<u8>) -> ListIterator {
let (list_ph, list_key) = self.make_list_key(list_key);
ListIterator {
store: &self,
Expand Down Expand Up @@ -826,7 +823,6 @@ impl CandyStore {
return Ok(0);
};

let list = *from_bytes::<List>(&list_bytes);
Ok(list.num_items as usize)
Ok(from_bytes::<List>(&list_bytes).num_items as usize)
}
}
2 changes: 1 addition & 1 deletion src/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ impl Shard {
key: &[u8],
val: &[u8],
mode: InsertMode,
) -> Result<TryReplaceStatus> {
) -> Result<TryReplaceStatus<'a>> {
let mut start = 0;
let mut had_collision = false;
while let Some(idx) = row.lookup(ph.signature(), &mut start) {
Expand Down

0 comments on commit b4db947

Please sign in to comment.