Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rroelke committed Mar 25, 2024
1 parent bb67b04 commit 576781c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
10 changes: 2 additions & 8 deletions tiledb/api/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ impl CompressionData {
}
}

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize)]
pub enum ScaleFloatByteWidth {
I8,
I16,
I32,
#[default] // keep in sync with tiledb/sm/filter/float_scaling_filter.h
I64,
}

Expand All @@ -109,13 +110,6 @@ impl ScaleFloatByteWidth {
}
}

impl Default for ScaleFloatByteWidth {
fn default() -> Self {
// keep in sync with tiledb/sm/filter/float_scaling_filter.h
ScaleFloatByteWidth::I64
}
}

impl TryFrom<std::ffi::c_ulonglong> for ScaleFloatByteWidth {
type Error = crate::error::Error;
fn try_from(value: std::ffi::c_ulonglong) -> TileDBResult<Self> {
Expand Down
24 changes: 12 additions & 12 deletions tiledb/test/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ pub fn arbitrary_data_for_datatype(
})
}

pub fn arbitrary_for_datatype<'ctx>(
context: &'ctx Context,
pub fn arbitrary_for_datatype(
context: &Context,
input_datatype: Datatype,
) -> impl Strategy<Value = TileDBResult<Filter<'ctx>>> {
) -> impl Strategy<Value = TileDBResult<Filter>> {
arbitrary_data_for_datatype(input_datatype)
.prop_map(|filter| Filter::create(context, filter))
}

pub fn arbitrary<'ctx>(
context: &'ctx Context,
) -> impl Strategy<Value = TileDBResult<Filter<'ctx>>> {
pub fn arbitrary(
context: &Context,
) -> impl Strategy<Value = TileDBResult<Filter>> {
arbitrary_data().prop_map(|filter| Filter::create(context, filter))
}

Expand All @@ -155,10 +155,10 @@ fn arbitrary_pipeline(
}
}

pub fn arbitrary_list_for_datatype<'ctx>(
context: &'ctx Context,
pub fn arbitrary_list_for_datatype(
context: &Context,
datatype: Datatype,
) -> impl Strategy<Value = TileDBResult<FilterList<'ctx>>> {
) -> impl Strategy<Value = TileDBResult<FilterList>> {
const MIN_FILTERS: usize = 0;
const MAX_FILTERS: usize = 4;

Expand Down Expand Up @@ -186,9 +186,9 @@ pub fn arbitrary_list_for_datatype<'ctx>(
})
}

pub fn arbitrary_list<'ctx>(
context: &'ctx Context,
) -> impl Strategy<Value = TileDBResult<FilterList<'ctx>>> {
pub fn arbitrary_list(
context: &Context,
) -> impl Strategy<Value = TileDBResult<FilterList>> {
crate::datatype::arbitrary()
.prop_flat_map(|dt| arbitrary_list_for_datatype(context, dt))
}
Expand Down

0 comments on commit 576781c

Please sign in to comment.