Skip to content

Commit 0194da8

Browse files
committed
Require chunks on all filters
1 parent f465234 commit 0194da8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

hdf5/src/hl/filters.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,6 @@ impl Filter {
517517
Ok(filters)
518518
})
519519
}
520-
521-
pub(crate) fn requires_chunking(&self) -> bool {
522-
COMP_FILTER_IDS.contains(&self.id())
523-
}
524520
}
525521

526522
const COMP_FILTER_IDS: &[H5Z_filter_t] = &[H5Z_FILTER_DEFLATE, H5Z_FILTER_SZIP, 32000, 32001];

hdf5/src/hl/plist/dataset_create.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,10 @@ impl DatasetCreateBuilder {
582582
}
583583

584584
fn populate_plist(&self, id: hid_t) -> Result<()> {
585+
if !self.filters.is_empty() {
586+
ensure!(self.chunk.is_some(), "Filter requires dataset to be chunked");
587+
}
585588
for filter in &self.filters {
586-
if filter.requires_chunking() {
587-
ensure!(self.chunk.is_some(), "Filter requires dataset to be chunked");
588-
}
589589
filter.apply_to_plist(id)?;
590590
}
591591
if let Some(v) = self.alloc_time {

0 commit comments

Comments
 (0)