Skip to content

Commit

Permalink
chore: renaming
Browse files Browse the repository at this point in the history
Signed-off-by: bsbds <69835502+bsbds@users.noreply.github.com>
  • Loading branch information
bsbds committed Jun 21, 2024
1 parent 06ccbf3 commit f3a224d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/xline/src/storage/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub(crate) trait IndexOperate {
sub_revision: i64,
) -> (KeyRevision, Option<KeyRevision>);

/// Gets the previous revision of the key
fn prev_rev(&self, key: &[u8]) -> Option<KeyRevision>;
/// Gets the latest revision of the key
fn current_rev(&self, key: &[u8]) -> Option<KeyRevision>;

/// Insert or update `KeyRevision`
fn insert(&self, key_revisions: Vec<(Vec<u8>, KeyRevision)>);
Expand Down Expand Up @@ -318,7 +318,7 @@ impl IndexOperate for Index {
)
}

fn prev_rev(&self, key: &[u8]) -> Option<KeyRevision> {
fn current_rev(&self, key: &[u8]) -> Option<KeyRevision> {
self.inner
.get(key)
.and_then(fmap_value(|revs| revs.last().copied()))
Expand Down Expand Up @@ -509,7 +509,7 @@ impl IndexState<'_> {
}

/// Reads an entry
#[allow(clippy::needless_pass_by_value)] // it's intended to comsume the entry
#[allow(clippy::needless_pass_by_value)] // it's intended to consume the entry
fn entry_read(entry: Entry<Vec<u8>, RwLock<Vec<KeyRevision>>>) -> (Vec<u8>, Vec<KeyRevision>) {
(entry.key().clone(), entry.value().read().clone())
}
Expand Down Expand Up @@ -581,7 +581,7 @@ impl IndexOperate for IndexState<'_> {
}
}

fn prev_rev(&self, key: &[u8]) -> Option<KeyRevision> {
fn current_rev(&self, key: &[u8]) -> Option<KeyRevision> {
let index = &self.index_ref.inner;
let state = self.state.lock();

Expand Down

0 comments on commit f3a224d

Please sign in to comment.