Skip to content

Commit ac79ef3

Browse files
authored
Add unused_qualifications with deny level to linter. Fix unused_qualifications violations." (#13086)
1 parent 4e38abd commit ac79ef3

File tree

170 files changed

+865
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+865
-1003
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,4 @@ large_futures = "warn"
169169

170170
[workspace.lints.rust]
171171
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin)"] }
172+
unused_qualifications = "deny"

datafusion-examples/examples/advanced_udaf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl Accumulator for GeometricMean {
193193
}
194194

195195
fn size(&self) -> usize {
196-
std::mem::size_of_val(self)
196+
size_of_val(self)
197197
}
198198
}
199199

@@ -394,8 +394,8 @@ impl GroupsAccumulator for GeometricMeanGroupsAccumulator {
394394
}
395395

396396
fn size(&self) -> usize {
397-
self.counts.capacity() * std::mem::size_of::<u32>()
398-
+ self.prods.capacity() * std::mem::size_of::<Float64Type>()
397+
self.counts.capacity() * size_of::<u32>()
398+
+ self.prods.capacity() * size_of::<Float64Type>()
399399
}
400400
}
401401

datafusion-examples/examples/custom_datasource.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct CustomDataSourceInner {
110110
}
111111

112112
impl Debug for CustomDataSource {
113-
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
113+
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
114114
f.write_str("custom_db")
115115
}
116116
}
@@ -220,7 +220,7 @@ impl CustomExec {
220220
}
221221

222222
impl DisplayAs for CustomExec {
223-
fn fmt_as(&self, _t: DisplayFormatType, f: &mut fmt::Formatter) -> std::fmt::Result {
223+
fn fmt_as(&self, _t: DisplayFormatType, f: &mut Formatter) -> fmt::Result {
224224
write!(f, "CustomExec")
225225
}
226226
}

datafusion-examples/examples/custom_file_format.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ impl FileFormat for TSVFileFormat {
7474
"tsv".to_string()
7575
}
7676

77-
fn get_ext_with_compression(
78-
&self,
79-
c: &FileCompressionType,
80-
) -> datafusion::error::Result<String> {
77+
fn get_ext_with_compression(&self, c: &FileCompressionType) -> Result<String> {
8178
if c == &FileCompressionType::UNCOMPRESSED {
8279
Ok("tsv".to_string())
8380
} else {

datafusion-examples/examples/flight/flight_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl FlightService for FlightServiceImpl {
105105
}
106106

107107
// add an initial FlightData message that sends schema
108-
let options = datafusion::arrow::ipc::writer::IpcWriteOptions::default();
108+
let options = arrow::ipc::writer::IpcWriteOptions::default();
109109
let schema_flight_data = SchemaAsIpc::new(&schema, &options);
110110

111111
let mut flights = vec![FlightData::from(schema_flight_data)];

datafusion-examples/examples/function_factory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl ScalarUDFImpl for ScalarFunctionWrapper {
121121
&self.name
122122
}
123123

124-
fn signature(&self) -> &datafusion_expr::Signature {
124+
fn signature(&self) -> &Signature {
125125
&self.signature
126126
}
127127

datafusion-examples/examples/simple_udaf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl Accumulator for GeometricMean {
131131
}
132132

133133
fn size(&self) -> usize {
134-
std::mem::size_of_val(self)
134+
size_of_val(self)
135135
}
136136
}
137137

datafusion-examples/examples/simplify_udaf_expression.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl AggregateUDFImpl for BetterAvgUdaf {
7070
unimplemented!("should not be invoked")
7171
}
7272

73-
fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<arrow_schema::Field>> {
73+
fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<Field>> {
7474
unimplemented!("should not be invoked")
7575
}
7676

@@ -90,8 +90,7 @@ impl AggregateUDFImpl for BetterAvgUdaf {
9090
fn simplify(&self) -> Option<AggregateFunctionSimplification> {
9191
// as an example for this functionality we replace UDF function
9292
// with build-in aggregate function to illustrate the use
93-
let simplify = |aggregate_function: datafusion_expr::expr::AggregateFunction,
94-
_: &dyn SimplifyInfo| {
93+
let simplify = |aggregate_function: AggregateFunction, _: &dyn SimplifyInfo| {
9594
Ok(Expr::AggregateFunction(AggregateFunction::new_udf(
9695
avg_udaf(),
9796
// yes it is the same Avg, `BetterAvgUdaf` was just a

datafusion-examples/examples/simplify_udwf_expression.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ impl WindowUDFImpl for SimplifySmoothItUdf {
7070

7171
/// this function will simplify `SimplifySmoothItUdf` to `SmoothItUdf`.
7272
fn simplify(&self) -> Option<WindowFunctionSimplification> {
73-
let simplify = |window_function: datafusion_expr::expr::WindowFunction,
74-
_: &dyn SimplifyInfo| {
73+
let simplify = |window_function: WindowFunction, _: &dyn SimplifyInfo| {
7574
Ok(Expr::WindowFunction(WindowFunction {
7675
fun: datafusion_expr::WindowFunctionDefinition::AggregateUDF(avg_udaf()),
7776
args: window_function.args,

datafusion/common/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ pub trait ConfigExtension: ExtensionOptions {
876876
}
877877

878878
/// An object-safe API for storing arbitrary configuration
879-
pub trait ExtensionOptions: Send + Sync + std::fmt::Debug + 'static {
879+
pub trait ExtensionOptions: Send + Sync + fmt::Debug + 'static {
880880
/// Return `self` as [`Any`]
881881
///
882882
/// This is needed until trait upcasting is stabilised

0 commit comments

Comments
 (0)