Skip to content

Commit d61929e

Browse files
committed
fix clippy warnings
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
1 parent 9a77e6f commit d61929e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

benchmarks/src/bin/dfbench.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ use datafusion::error::Result;
2020

2121
use clap::{Parser, Subcommand};
2222

23-
#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
23+
#[cfg(all(feature = "snmalloc", feature = "mimalloc", not(clippy)))]
2424
compile_error!(
2525
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
2626
);
2727

28-
#[cfg(feature = "snmalloc")]
28+
#[cfg(all(feature = "snmalloc", not(feature = "mimalloc")))]
2929
#[global_allocator]
3030
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
3131

32-
#[cfg(feature = "mimalloc")]
32+
#[cfg(all(feature = "mimalloc", not(feature = "snmalloc")))]
3333
#[global_allocator]
3434
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
3535

benchmarks/src/bin/imdb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ use clap::{Parser, Subcommand};
2121
use datafusion::error::Result;
2222
use datafusion_benchmarks::imdb;
2323

24-
#[cfg(all(feature = "snmalloc", feature = "mimalloc"))]
24+
#[cfg(all(feature = "snmalloc", feature = "mimalloc", not(clippy)))]
2525
compile_error!(
2626
"feature \"snmalloc\" and feature \"mimalloc\" cannot be enabled at the same time"
2727
);
2828

29-
#[cfg(feature = "snmalloc")]
29+
#[cfg(all(feature = "snmalloc", not(feature = "mimalloc")))]
3030
#[global_allocator]
3131
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
3232

33-
#[cfg(feature = "mimalloc")]
33+
#[cfg(all(feature = "mimalloc", not(feature = "snmalloc")))]
3434
#[global_allocator]
3535
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
3636

datafusion/common/src/error.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,6 @@ mod test {
12431243
// To pass the test the environment variable RUST_BACKTRACE should be set to 1 to enforce backtrace
12441244
#[cfg(feature = "backtrace")]
12451245
#[test]
1246-
#[expect(clippy::unnecessary_literal_unwrap)]
12471246
fn test_enabled_backtrace() {
12481247
match std::env::var("RUST_BACKTRACE") {
12491248
Ok(val) if val == "1" => {}

datafusion/common/src/hash_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ fn hash_array<T>(
276276
/// HAS_NULLS: do we have to check null in the inner loop
277277
/// HAS_BUFFERS: if true, array has external buffers; if false, all strings are inlined/ less then 12 bytes
278278
/// REHASH: if true, combining with existing hash, otherwise initializing
279+
#[cfg(not(feature = "force_hash_collisions"))]
279280
#[inline(never)]
280281
fn hash_string_view_array_inner<
281282
T: ByteViewType,

datafusion/optimizer/src/rewrite_set_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use datafusion_expr::utils::merge_schema;
3838
pub struct RewriteSetComparison;
3939

4040
impl RewriteSetComparison {
41-
#[allow(missing_docs)]
41+
/// Create a new `RewriteSetComparison` optimizer rule.
4242
pub fn new() -> Self {
4343
Self
4444
}

datafusion/sql/src/expr/subquery.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
178178
let mut spans = Spans::new();
179179
if let SetExpr::Select(select) = subquery.body.as_ref() {
180180
for item in &select.projection {
181-
if let SelectItem::ExprWithAlias { alias, .. } = item {
182-
if let Some(span) = Span::try_from_sqlparser_span(alias.span) {
183-
spans.add_span(span);
184-
}
181+
if let SelectItem::ExprWithAlias { alias, .. } = item
182+
&& let Some(span) = Span::try_from_sqlparser_span(alias.span)
183+
{
184+
spans.add_span(span);
185185
}
186186
}
187187
}

0 commit comments

Comments
 (0)