Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
giangndm committed Dec 12, 2024
1 parent f3ac611 commit 899faf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/service/replicate_kv_service/local_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ where
self.outs.push_back(NetEvent::Unicast(from_node, RpcEvent::RpcRes(res)));
}
RpcReq::FetchSnapshot => {
let snapshot = self.snaphsot();
let snapshot = self.snapshot();
let res = RpcRes::FetchSnapshot {
slots: snapshot,
version: self.version,
Expand All @@ -75,18 +75,14 @@ where
}
}

pub fn changeds_from_to(&self, from: Version, to: Option<Version>) -> Vec<Changed<V>> {
fn changeds_from_to(&self, from: Version, to: Option<Version>) -> Vec<Changed<V>> {
self.changeds.range(from..=to.unwrap_or(self.version)).map(|(_, v)| v.clone()).collect()
}

pub fn snaphsot(&self) -> Vec<(Key, Slot<V>)> {
fn snapshot(&self) -> Vec<(Key, Slot<V>)> {
self.slots.iter().map(|(k, v)| (k.clone(), v.clone())).collect::<Vec<_>>()
}

pub fn version(&self) -> Version {
self.version
}

pub fn pop_out(&mut self) -> Option<NetEvent<N, V>> {
self.outs.pop_front()
}
Expand Down
4 changes: 2 additions & 2 deletions src/service/replicate_kv_service/remote_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
use super::{Action, BroadcastEvent, Changed, Key, NetEvent, RpcEvent, RpcReq, RpcRes, Slot, Version};

#[derive(Debug)]
pub enum RemoteStoreState<N, V> {
enum RemoteStoreState<N, V> {
SyncFull(SyncFullState<N, V>),
SyncPart(SyncPartState<N, V>),
Working(WorkingState<N, V>),
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<N, V> SyncPartState<N, V> {
}

impl<N, V> SyncPartState<N, V> {
/// we check if pendings list is continuos and start with from_version and end with remain is false
/// we check if pendings list is continuous and start with from_version and end with remain is false
fn is_finished(&self) -> bool {
if self.pendings.is_empty() {
return false;
Expand Down

0 comments on commit 899faf0

Please sign in to comment.