Skip to content
Merged
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
3 changes: 1 addition & 2 deletions columnar/src/column/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ pub fn open_column_bytes(
);
let (dictionary_bytes, column_bytes) = body.split(dictionary_len as usize);

let dictionary_bytes = dictionary_bytes.read_bytes()?;
let dictionary = Arc::new(Dictionary::from_bytes(dictionary_bytes)?);
let dictionary = Arc::new(Dictionary::open(dictionary_bytes)?);
let term_ord_column = crate::column::open_column_u64::<u64>(column_bytes, format_version)?;
Ok(BytesColumn {
dictionary,
Expand Down
4 changes: 2 additions & 2 deletions sstable/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
dictionary_writer.insert(term, &()).unwrap();
}
dictionary_writer.finish().unwrap();
Dictionary::from_bytes(OwnedBytes::new(buffer)).unwrap()
Dictionary::from_bytes_for_tests(OwnedBytes::new(buffer)).unwrap()
}
}

Expand Down Expand Up @@ -306,10 +306,10 @@
}
}
_ => {
return Err(io::Error::new(
io::ErrorKind::Other,
format!("Unsupported sstable version, expected one of [2, 3], found {version}"),
))

Check warning on line 312 in sstable/src/dictionary.rs

View workflow job for this annotation

GitHub Actions / clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)` --> sstable/src/dictionary.rs:309:28 | 309 | return Err(io::Error::new( | ____________________________^ 310 | | io::ErrorKind::Other, 311 | | format!("Unsupported sstable version, expected one of [2, 3], found {version}"), 312 | | )) | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error = note: `#[warn(clippy::io_other_error)]` on by default help: use `std::io::Error::other` | 309 ~ return Err(io::Error::other( 310 ~ format!("Unsupported sstable version, expected one of [2, 3], found {version}"), |
}
};

Expand All @@ -322,7 +322,7 @@
}

/// Creates a term dictionary from the supplied bytes.
pub fn from_bytes(owned_bytes: OwnedBytes) -> io::Result<Self> {
pub fn from_bytes_for_tests(owned_bytes: OwnedBytes) -> io::Result<Self> {
Dictionary::open(FileSlice::new(Arc::new(owned_bytes)))
}

Expand Down
2 changes: 1 addition & 1 deletion sstable/src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
dict_builder.insert(b"abandon", &3)?;
let buffer = dict_builder.finish()?;
let owned_bytes = OwnedBytes::new(buffer);
Dictionary::from_bytes(owned_bytes)
Dictionary::from_bytes_for_tests(owned_bytes)
}

#[test]
Expand Down Expand Up @@ -386,14 +386,14 @@
true
}

pub fn next(&mut self) -> Option<(&[u8], &TSSTable::Value, A::State)> {
if self.advance() {
let st = self.current_state.clone().unwrap();
Some((self.key(), self.value(), st))
} else {
None
}
}

Check warning on line 396 in sstable/src/streamer.rs

View workflow job for this annotation

GitHub Actions / clippy

method `next` can be confused for the standard trait method `std::iter::Iterator::next`

warning: method `next` can be confused for the standard trait method `std::iter::Iterator::next` --> sstable/src/streamer.rs:389:5 | 389 | / pub fn next(&mut self) -> Option<(&[u8], &TSSTable::Value, A::State)> { 390 | | if self.advance() { 391 | | let st = self.current_state.clone().unwrap(); 392 | | Some((self.key(), self.value(), st)) ... | 396 | | } | |_____^ | = help: consider implementing the trait `std::iter::Iterator` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait = note: `#[warn(clippy::should_implement_trait)]` on by default

pub fn key(&self) -> &[u8] {
self.streamer.key()
Expand Down
Loading