Skip to content

Commit ef7ee8c

Browse files
committed
Add cfg to document item availability
1 parent b810b31 commit ef7ee8c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/hl/filters.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub enum ScaleOffset {
3636
#[cfg(feature = "blosc")]
3737
mod blosc_impl {
3838
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
39+
#[cfg(feature = "blosc")]
3940
pub enum Blosc {
4041
BloscLZ,
4142
LZ4,
@@ -46,18 +47,21 @@ mod blosc_impl {
4647
}
4748

4849
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
50+
#[cfg(feature = "blosc")]
4951
pub enum BloscShuffle {
5052
None,
5153
Byte,
5254
Bit,
5355
}
5456

57+
#[cfg(feature = "blosc")]
5558
impl Default for BloscShuffle {
5659
fn default() -> Self {
5760
Self::Byte
5861
}
5962
}
6063

64+
#[cfg(feature = "blosc")]
6165
impl From<bool> for BloscShuffle {
6266
fn from(shuffle: bool) -> Self {
6367
if shuffle {
@@ -68,16 +72,19 @@ mod blosc_impl {
6872
}
6973
}
7074

75+
#[cfg(feature = "blosc")]
7176
impl Default for Blosc {
7277
fn default() -> Self {
7378
Self::BloscLZ
7479
}
7580
}
7681

82+
#[cfg(feature = "blosc")]
7783
pub fn blosc_get_nthreads() -> u8 {
7884
h5lock!(super::blosc::blosc_get_nthreads()).max(0).min(255) as _
7985
}
8086

87+
#[cfg(feature = "blosc")]
8188
pub fn blosc_set_nthreads(num_threads: u8) -> u8 {
8289
use std::os::raw::c_int;
8390
let nthreads = h5lock!(super::blosc::blosc_set_nthreads(c_int::from(num_threads)));

src/hl/location.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,11 @@ impl Location {
148148
}
149149
}
150150

151-
#[cfg(feature = "1.12.0")]
152-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153-
pub struct LocationToken(H5O_token_t);
154-
155-
#[cfg(not(feature = "1.12.0"))]
156151
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
157-
pub struct LocationToken(haddr_t);
152+
pub struct LocationToken(
153+
#[cfg(not(feature = "1.12.0"))] haddr_t,
154+
#[cfg(feature = "1.12.0")] H5O_token_t,
155+
);
158156

159157
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
160158
pub enum LocationType {

0 commit comments

Comments
 (0)