Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Dec 19, 2024
1 parent 95666f0 commit 3a8127a
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::model::events::{CommunityEventInternal, CommunityEventInternalOld};
use crate::model::events::CommunityEventInternal;
use candid::Deserialize;
use serde::Serialize;
use stable_memory_map::{with_map, with_map_mut, CommunityEventKeyPrefix, KeyPrefix};
Expand All @@ -10,14 +10,6 @@ pub struct EventsStableStorage {
}

impl EventsStableStorage {
pub fn read_all(&self) -> Vec<EventWrapperInternal<CommunityEventInternalOld>> {
with_map(|m| {
m.range(self.prefix.create_key(&EventIndex::default())..)
.map(|(_, bytes)| msgpack::deserialize_then_unwrap(&bytes))
.collect()
})
}

pub fn insert(&mut self, event: EventWrapperInternal<CommunityEventInternal>) {
with_map_mut(|m| m.insert(self.prefix.create_key(&event.index), event_to_bytes(event)));
}
Expand Down

0 comments on commit 3a8127a

Please sign in to comment.