Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through bytes dependency to value-log #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ lz4 = ["dep:lz4_flex"]
miniz = ["dep:miniz_oxide"]
bloom = []
all = ["bloom", "lz4", "miniz"]
bytes = ["value-log/bytes"]

[dependencies]
byteorder = "1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion src/compaction/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<I: Iterator<Item = crate::Result<InternalValue>>> CompactionStream<I> {
};

// Consume version
if &next.key.user_key == key {
if next.key.user_key == key {
// NOTE: We know the next value is not empty, because we just peeked it
#[allow(clippy::expect_used)]
self.inner.next().expect("should not be empty")?;
Expand Down
8 changes: 4 additions & 4 deletions src/level_manifest/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ impl<'a> DisjointLevel<'a> {
let lo = match &key_range.0 {
Bound::Unbounded => 0,
Bound::Included(start_key) => {
level.partition_point(|segment| &segment.metadata.key_range.1 < start_key)
level.partition_point(|segment| segment.metadata.key_range.1 < start_key)
}
Bound::Excluded(start_key) => {
level.partition_point(|segment| &segment.metadata.key_range.1 <= start_key)
level.partition_point(|segment| segment.metadata.key_range.1 <= start_key)
}
};

Expand All @@ -187,7 +187,7 @@ impl<'a> DisjointLevel<'a> {
let hi = match &key_range.1 {
Bound::Unbounded => level.len() - 1,
Bound::Included(end_key) => {
let idx = level.partition_point(|segment| &segment.metadata.key_range.0 <= end_key);
let idx = level.partition_point(|segment| segment.metadata.key_range.0 <= end_key);

if idx == 0 {
return None;
Expand All @@ -196,7 +196,7 @@ impl<'a> DisjointLevel<'a> {
idx.saturating_sub(1) // To avoid underflow
}
Bound::Excluded(end_key) => {
let idx = level.partition_point(|segment| &segment.metadata.key_range.0 < end_key);
let idx = level.partition_point(|segment| segment.metadata.key_range.0 < end_key);

if idx == 0 {
return None;
Expand Down
2 changes: 1 addition & 1 deletion src/mvcc_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<I: DoubleEndedIterator<Item = crate::Result<InternalValue>>> MvccStream<I>
};

// Consume version
if &next.key.user_key == key {
if next.key.user_key == key {
// NOTE: We know the next value is not empty, because we just peeked it
#[allow(clippy::expect_used)]
self.inner.next().expect("should not be empty")?;
Expand Down
2 changes: 1 addition & 1 deletion src/segment/block_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl BlockIndex for [KeyedBlockHandle] {
return Ok(None);
};

if &last_block.end_key < key {
if last_block.end_key < key {
return Ok(None);
}

Expand Down
Loading