Skip to content

Apache DataFusion SQL Query Engine

Fix new clippy lint (#6535)

Andrew Lambe6af36a5409b
diff --git a/datafusion/core/src/physical_plan/aggregates/bounded_aggregate_stream.rs b/datafusion/core/src/physical_plan/aggregates/bounded_aggregate_stream.rs
index 1eed235850..4bbac3c4a5 100644
--- a/datafusion/core/src/physical_plan/aggregates/bounded_aggregate_stream.rs
+++ b/datafusion/core/src/physical_plan/aggregates/bounded_aggregate_stream.rs
@@ -407,8 +407,7 @@ impl BoundedAggregateStream {
// NOTE: do NOT include the `RowGroupState` struct size in here because this is captured by
// `group_states` (see allocation down below)
- *allocated += (std::mem::size_of::<u8>()
- * group_state.group_by_values.as_ref().len())
+ *allocated += std::mem::size_of_val(&group_state.group_by_values)
+ (std::mem::size_of::<u8>()
* group_state.aggregation_buffer.capacity())
+ (std::mem::size_of::<u32>() * group_state.indices.capacity());
@@ -514,8 +513,7 @@ impl BoundedAggregateStream {
// NOTE: do NOT include the `GroupState` struct size in here because this is captured by
// `group_states` (see allocation down below)
- *allocated += (std::mem::size_of::<u8>()
- * group_state.group_by_values.as_ref().len())
+ *allocated += std::mem::size_of_val(&group_state.group_by_values)
+ (std::mem::size_of::<u8>()
* group_state.aggregation_buffer.capacity())
+ (std::mem::size_of::<u32>() * group_state.indices.capacity());
diff --git a/datafusion/core/src/physical_plan/aggregates/row_hash.rs b/datafusion/core/src/physical_plan/aggregates/row_hash.rs
index a1e0481757..ba02bc096b 100644
--- a/datafusion/core/src/physical_plan/aggregates/row_hash.rs
+++ b/datafusion/core/src/physical_plan/aggregates/row_hash.rs
@@ -368,8 +368,7 @@ impl GroupedHashAggregateStream {
// NOTE: do NOT include the `GroupState` struct size in here because this is captured by
// `group_states` (see allocation down below)
- *allocated += (std::mem::size_of::<u8>()
- * group_state.group_by_values.as_ref().len())
+ *allocated += std::mem::size_of_val(&group_state.group_by_values)
+ (std::mem::size_of::<u8>()
* group_state.aggregation_buffer.capacity())
+ (std::mem::size_of::<u32>() * group_state.indices.capacity());
diff --git a/datafusion/expr/src/conditional_expressions.rs b/datafusion/expr/src/conditional_expressions.rs
index 2518e9e225..aba4406138 100644
--- a/datafusion/expr/src/conditional_expressions.rs
+++ b/datafusion/expr/src/conditional_expressions.rs
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+//! Conditional expressions
use crate::expr::Case;
-///! Conditional expressions
use crate::{expr_schema::ExprSchemable, Expr};
use arrow::datatypes::DataType;
use datafusion_common::{DFSchema, DataFusionError, Result};
diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs
index 077187561f..798a54273c 100644
--- a/datafusion/expr/src/logical_plan/plan.rs
+++ b/datafusion/expr/src/logical_plan/plan.rs
@@ -15,9 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+//! Logical plan types
+
use crate::expr::InSubquery;
use crate::expr::{Exists, Placeholder};
-///! Logical plan types
use crate::logical_plan::display::{GraphvizVisitor, IndentVisitor};
use crate::logical_plan::extension::UserDefinedLogicalNode;
use crate::logical_plan::{DmlStatement, Statement};
diff --git a/datafusion/expr/src/table_source.rs b/datafusion/expr/src/table_source.rs
index 5954335c67..2f5a8923e8 100644
--- a/datafusion/expr/src/table_source.rs
+++ b/datafusion/expr/src/table_source.rs
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
+//! Table source
+
use crate::{Expr, LogicalPlan};
use arrow::datatypes::SchemaRef;
use datafusion_common::Result;
use std::any::Any;
-///! Table source
-
/// Indicates whether and how a filter expression can be handled by a
/// TableProvider for table scans.
#[derive(Debug, Clone, PartialEq, Eq)]