diff --git a/scylla-rust-wrapper/build.rs b/scylla-rust-wrapper/build.rs index 917d6439..1645cfe5 100644 --- a/scylla-rust-wrapper/build.rs +++ b/scylla-rust-wrapper/build.rs @@ -71,6 +71,11 @@ fn prepare_cppdriver_data(outfile: &str, allowed_types: &[&str], out_path: &Path for t in allowed_types { type_bindings = type_bindings.allowlist_type(t); } + + // Prevent these clippy complaints: + // `warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique` + type_bindings = type_bindings.no_partialeq(".*Callback.*"); + let type_bindings = type_bindings .generate() .expect("Unable to generate bindings"); diff --git a/scylla-rust-wrapper/src/collection.rs b/scylla-rust-wrapper/src/collection.rs index b57a3167..d749e41c 100644 --- a/scylla-rust-wrapper/src/collection.rs +++ b/scylla-rust-wrapper/src/collection.rs @@ -85,10 +85,10 @@ impl CassCollection { match data_type { CassDataTypeInner::List { typ: subtype, .. } | CassDataTypeInner::Set { typ: subtype, .. } => { - if let Some(subtype) = subtype { - if !value::is_type_compatible(value, subtype) { - return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE; - } + if let Some(subtype) = subtype + && !value::is_type_compatible(value, subtype) + { + return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE; } } diff --git a/scylla-rust-wrapper/src/tuple.rs b/scylla-rust-wrapper/src/tuple.rs index 4af6f1c1..e22a8866 100644 --- a/scylla-rust-wrapper/src/tuple.rs +++ b/scylla-rust-wrapper/src/tuple.rs @@ -43,10 +43,10 @@ impl CassTuple { return CassError::CASS_ERROR_LIB_INDEX_OUT_OF_BOUNDS; } - if let Some(inner_types) = self.get_types() { - if !value::is_type_compatible(&v, &inner_types[index]) { - return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE; - } + if let Some(inner_types) = self.get_types() + && !value::is_type_compatible(&v, &inner_types[index]) + { + return CassError::CASS_ERROR_LIB_INVALID_VALUE_TYPE; } self.items[index] = v;