Skip to content

Commit

Permalink
don't use pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
nanu-c committed Nov 18, 2023
1 parent 03d5558 commit da4ef19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions presage-store-sled/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl SledStore {
format!("{:x}", hasher.finalize())
}

fn thread_metadata_key(&self, thread: &Thread) -> Vec<u8> {
fn thread_metadata_key(&self, thread: Thread) -> Vec<u8> {
match thread {
Thread::Contact(contact) => contact.to_string().into_bytes(),
Thread::Group(group) => group.to_vec(),
Expand Down Expand Up @@ -630,14 +630,14 @@ impl ContentsStore for SledStore {
&mut self,
metadata: ThreadMetadata,
) -> Result<(), Self::ContentsStoreError> {
let key = self.thread_metadata_key(&metadata.thread);
let key = self.thread_metadata_key(metadata.thread.clone());
self.insert(SLED_TREE_THREADS_METADATA, key, metadata)?;
Ok(())
}

fn thread_metadata(
&self,
thread: &Thread,
thread: Thread,
) -> Result<Option<ThreadMetadata>, Self::ContentsStoreError> {
let key = self.thread_metadata_key(thread);
self.get(SLED_TREE_THREADS_METADATA, key)
Expand Down
2 changes: 1 addition & 1 deletion presage/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub trait ContentsStore {
/// Retrieve ThereadMetadata for a single thread.
fn thread_metadata(
&self,
thread: &Thread,
thread: Thread,
) -> Result<Option<ThreadMetadata>, Self::ContentsStoreError>;

/// Save ThereadMetadata for a single thread.
Expand Down

0 comments on commit da4ef19

Please sign in to comment.