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
2 changes: 1 addition & 1 deletion src/data_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct GridIter<'a, ValueTy> {
node_3: Option<&'a Node3<ValueTy>>,
}

impl<'a, ValueTy> Iterator for GridIter<'a, ValueTy>
impl<ValueTy> Iterator for GridIter<'_, ValueTy>
where
ValueTy: Copy,
{
Expand Down
5 changes: 4 additions & 1 deletion src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ impl<R: Read + Seek> VdbReader<R> {
gd: &GridDescriptor,
count: usize,
) -> Result<Vec<T>, ParseError> {
if count == 0 {
return Ok(Vec::new());
}
Ok(if gd.compression.contains(Compression::BLOSC) {
let num_compressed_bytes = reader.read_i64::<LittleEndian>()?;
let compressed_count = num_compressed_bytes / std::mem::size_of::<T>() as i64;
Expand Down Expand Up @@ -276,7 +279,7 @@ impl<R: Read + Seek> VdbReader<R> {
"Skipping blosc decompression because of a {}-count read",
count
);
vec![T::zeroed(); 0]
Vec::new()
}
}
} else if gd.compression.contains(Compression::ZIP) {
Expand Down
Loading