diff --git a/crates/xline/src/storage/index.rs b/crates/xline/src/storage/index.rs index fb84050c7..88c891991 100644 --- a/crates/xline/src/storage/index.rs +++ b/crates/xline/src/storage/index.rs @@ -28,8 +28,8 @@ pub(crate) trait IndexOperate { sub_revision: i64, ) -> (KeyRevision, Option); - /// Gets the previous revision of the key - fn prev_rev(&self, key: &[u8]) -> Option; + /// Gets the latest revision of the key + fn current_rev(&self, key: &[u8]) -> Option; /// Insert or update `KeyRevision` fn insert(&self, key_revisions: Vec<(Vec, KeyRevision)>); @@ -318,7 +318,7 @@ impl IndexOperate for Index { ) } - fn prev_rev(&self, key: &[u8]) -> Option { + fn current_rev(&self, key: &[u8]) -> Option { self.inner .get(key) .and_then(fmap_value(|revs| revs.last().copied())) @@ -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, RwLock>>) -> (Vec, Vec) { (entry.key().clone(), entry.value().read().clone()) } @@ -581,7 +581,7 @@ impl IndexOperate for IndexState<'_> { } } - fn prev_rev(&self, key: &[u8]) -> Option { + fn current_rev(&self, key: &[u8]) -> Option { let index = &self.index_ref.inner; let state = self.state.lock();