Skip to content

Commit

Permalink
query-engine-c-abi: Fix build warnings after update (#4864)
Browse files Browse the repository at this point in the history
`rustc` now detects unused trait methods, which means we need to make a
new offering to the gods of `cfg[feature=]`.
  • Loading branch information
SevInf committed May 10, 2024
1 parent a8ad08f commit b046ee1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quaint/src/connector/sqlite/native/conversion.rs
Expand Up @@ -82,6 +82,7 @@ impl TypeIdentifier for Column<'_> {
)
}

#[cfg(feature = "mysql")]
fn is_time(&self) -> bool {
false
}
Expand Down Expand Up @@ -118,9 +119,12 @@ impl TypeIdentifier for Column<'_> {
matches!(self.decl_type(), Some("BOOLEAN") | Some("boolean"))
}

#[cfg(feature = "mysql")]
fn is_json(&self) -> bool {
false
}

#[cfg(feature = "mysql")]
fn is_enum(&self) -> bool {
false
}
Expand Down
3 changes: 3 additions & 0 deletions quaint/src/connector/type_identifier.rs
Expand Up @@ -5,12 +5,15 @@ pub(crate) trait TypeIdentifier {
fn is_int32(&self) -> bool;
fn is_int64(&self) -> bool;
fn is_datetime(&self) -> bool;
#[cfg(feature = "mysql")]
fn is_time(&self) -> bool;
fn is_date(&self) -> bool;
fn is_text(&self) -> bool;
fn is_bytes(&self) -> bool;
fn is_bool(&self) -> bool;
#[cfg(feature = "mysql")]
fn is_json(&self) -> bool;
#[cfg(feature = "mysql")]
fn is_enum(&self) -> bool;
fn is_null(&self) -> bool;
}
Expand Up @@ -7,6 +7,7 @@ pub(crate) trait QueryArgumentsExt {
/// Checks whether any form of memory processing is needed, or we could just return the records
/// as they are. This is useful to avoid turning an existing collection of records into an
/// iterator and re-collecting it back with no changes.
#[cfg(feature = "relation_joins")]
fn needs_inmemory_processing_with_joins(&self) -> bool;
}

Expand All @@ -15,6 +16,7 @@ impl QueryArgumentsExt for QueryArguments {
self.take.map(|t| t < 0).unwrap_or(false)
}

#[cfg(feature = "relation_joins")]
fn needs_inmemory_processing_with_joins(&self) -> bool {
self.needs_reversed_order()
|| self.requires_inmemory_distinct_with_joins()
Expand Down

0 comments on commit b046ee1

Please sign in to comment.