fix: Remove ::default() when constructing unit structs

As recommended by https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
pull/24376/head
Carol (Nichols || Goulding) 2023-07-14 10:30:04 -04:00
parent d40bc54b71
commit 10a0f8e3bf
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
36 changed files with 125 additions and 125 deletions

View File

@ -330,7 +330,7 @@ mod tests {
}
fn make_rng() -> StdRng {
let seed = OsRng::default().next_u64();
let seed = OsRng.next_u64();
println!("Seed: {seed}");
StdRng::seed_from_u64(seed)
}

View File

@ -583,7 +583,7 @@ where
metric_count,
metric_usage,
metric_evicted,
_phantom: PhantomData::default(),
_phantom: PhantomData,
}));
pool.inner.lock().register_member(

View File

@ -327,7 +327,7 @@ where
lock_inner!(guard = self.inner);
InnerBackendRef {
inner: guard.inner.lock_arc(),
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
}

View File

@ -95,8 +95,8 @@ where
backoff_cfg_some: Option<BackoffConfig>,
) -> Self {
Self {
_k: PhantomData::default(),
_v: PhantomData::default(),
_k: PhantomData,
_v: PhantomData,
backoff_cfg_none,
backoff_cfg_some,
}

View File

@ -56,7 +56,7 @@ where
let policy_constructor = move |callback_handle| {
*handle_captured.callback_handle.lock() = Some(callback_handle);
Self {
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
};

View File

@ -76,8 +76,8 @@ where
/// Create new provider with the given TTL value.
pub fn new(ttl: Option<Duration>) -> Self {
Self {
_k: PhantomData::default(),
_v: PhantomData::default(),
_k: PhantomData,
_v: PhantomData,
ttl,
}
}
@ -122,8 +122,8 @@ where
/// Create new provider with the given TTL values for `None` and `Some(...)`.
pub fn new(ttl_none: Option<Duration>, ttl_some: Option<Duration>) -> Self {
Self {
_k: PhantomData::default(),
_v: PhantomData::default(),
_k: PhantomData,
_v: PhantomData,
ttl_none,
ttl_some,
}

View File

@ -93,7 +93,7 @@ where
pub fn new(loader: T) -> Self {
Self {
loader,
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
}

View File

@ -97,7 +97,7 @@ where
pub fn new(f: F) -> Self {
Self {
estimator: f,
_phantom: PhantomData::default(),
_phantom: PhantomData,
}
}
}

View File

@ -12,7 +12,7 @@ pub struct NoopDataFusionPlanExec;
impl NoopDataFusionPlanExec {
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -24,7 +24,7 @@ pub struct PanicDataFusionPlanner;
impl PanicDataFusionPlanner {
/// Create a new planner
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -16,7 +16,7 @@ pub struct MultipleBranchesDivideInitial;
impl MultipleBranchesDivideInitial {
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -11,7 +11,7 @@ pub struct HasFilesPartitionFilter;
impl HasFilesPartitionFilter {
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -11,7 +11,7 @@ pub struct ManyFilesRoundSplit;
impl ManyFilesRoundSplit {
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -12,7 +12,7 @@ pub struct NoopScratchpadGen;
impl NoopScratchpadGen {
pub fn new() -> Self {
Self::default()
Self
}
}

View File

@ -258,7 +258,7 @@ where
inner,
headers: parts.headers.clone(),
call: call.clone(),
_phantom_error_logger: PhantomData::default(),
_phantom_error_logger: PhantomData,
});
call.log(LogEntry::ServerHeaders(&parts.headers));
if body.is_end_stream() {

View File

@ -61,7 +61,7 @@ fn wal_replay_bench(c: &mut Criterion) {
// Pass all writes into a NOP that discards them with no
// overhead.
let sink = NopSink::default();
let sink = NopSink;
let persist = MockPersistQueue::default();

View File

@ -304,7 +304,7 @@ where
Arc::clone(&catalog),
// Register a post-persistence observer that emits Parquet file
// attributes as metrics.
ParquetFileInstrumentation::new(NopObserver::default(), &metrics),
ParquetFileInstrumentation::new(NopObserver, &metrics),
&metrics,
);
let persist_handle = Arc::new(persist_handle);

View File

@ -885,7 +885,7 @@ mod tests {
Arc::new(Executor::new_testing()),
storage,
catalog,
NopObserver::default(),
NopObserver,
&metrics,
);
assert!(ingest_state.read().is_ok());
@ -955,7 +955,7 @@ mod tests {
Arc::new(Executor::new_testing()),
storage,
catalog,
NopObserver::default(),
NopObserver,
&metrics,
);

View File

@ -285,7 +285,7 @@ mod tests {
.await
.expect("failed to initialise WAL");
let wal_sink = WalSink::new(BlockingDmlSink::default(), wal);
let wal_sink = WalSink::new(BlockingDmlSink, wal);
// Allow tokio to automatically advance time past the timeout duration,
// when all threads are blocked on await points.

View File

@ -587,7 +587,7 @@ mod test {
}
fn optimize(plan: &LogicalPlan) -> Result<Option<LogicalPlan>> {
let optimizer = Optimizer::with_rules(vec![Arc::new(HandleGapFill::default())]);
let optimizer = Optimizer::with_rules(vec![Arc::new(HandleGapFill)]);
optimizer.optimize_recursively(
optimizer.rules.get(0).unwrap(),
plan,

View File

@ -104,7 +104,7 @@ mod tests {
2,
),
]));
let opt = CombineChunks::default();
let opt = CombineChunks;
let mut config = ConfigOptions::default();
config.execution.target_partitions = 2;
insta::assert_yaml_snapshot!(
@ -145,7 +145,7 @@ mod tests {
.unwrap(),
),
]));
let opt = CombineChunks::default();
let opt = CombineChunks;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -175,7 +175,7 @@ mod tests {
let chunk1 = TestChunk::new("table").with_id(1);
let schema = chunk1.schema().as_arrow();
let plan = chunks_to_physical_nodes(&schema, None, vec![], 2);
let opt = CombineChunks::default();
let opt = CombineChunks;
let mut config = ConfigOptions::default();
config.execution.target_partitions = 2;
insta::assert_yaml_snapshot!(
@ -202,7 +202,7 @@ mod tests {
)
.unwrap(),
)]));
let opt = CombineChunks::default();
let opt = CombineChunks;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -111,7 +111,7 @@ mod tests {
fn test_no_chunks() {
let schema = chunk(1).schema().clone();
let plan = dedup_plan(schema, vec![]);
let opt = DedupNullColumns::default();
let opt = DedupNullColumns;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -132,7 +132,7 @@ mod tests {
let chunk = chunk(1).with_dummy_parquet_file();
let schema = chunk.schema().clone();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupNullColumns::default();
let opt = DedupNullColumns;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -155,7 +155,7 @@ mod tests {
let chunk = chunk(1).with_dummy_parquet_file();
let schema = chunk.schema().clone();
let plan = dedup_plan_with_chunk_order_col(schema, vec![chunk]);
let opt = DedupNullColumns::default();
let opt = DedupNullColumns;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -187,7 +187,7 @@ mod tests {
.build()
.unwrap();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupNullColumns::default();
let opt = DedupNullColumns;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -228,7 +228,7 @@ mod tests {
.build()
.unwrap();
let plan = dedup_plan(schema, vec![chunk1, chunk2]);
let opt = DedupNullColumns::default();
let opt = DedupNullColumns;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -183,7 +183,7 @@ mod tests {
fn test_no_chunks() {
let schema = chunk(1).schema().clone();
let plan = dedup_plan(schema, vec![]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -204,7 +204,7 @@ mod tests {
let chunk = chunk(1).with_dummy_parquet_file();
let schema = chunk.schema().clone();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -233,7 +233,7 @@ mod tests {
]));
let schema = chunk.schema().clone();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -262,7 +262,7 @@ mod tests {
]));
let schema = chunk.schema().clone();
let plan = dedup_plan_with_chunk_order_col(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -291,7 +291,7 @@ mod tests {
]));
let schema = chunk.schema().clone();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -320,7 +320,7 @@ mod tests {
]));
let schema = chunk.schema().clone();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -353,7 +353,7 @@ mod tests {
.build()
.unwrap();
let plan = dedup_plan(schema, vec![chunk]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -389,7 +389,7 @@ mod tests {
]));
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -424,7 +424,7 @@ mod tests {
]));
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -454,7 +454,7 @@ mod tests {
let chunk2 = chunk(2).with_dummy_parquet_file();
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -511,7 +511,7 @@ mod tests {
]));
let schema = chunk3.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -562,7 +562,7 @@ mod tests {
]));
let schema = chunk3.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -615,7 +615,7 @@ mod tests {
]));
let schema = chunk3.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = DedupSortOrder::default();
let opt = DedupSortOrder;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -122,7 +122,7 @@ mod tests {
fn test_no_chunks() {
let schema = chunk(1).schema().clone();
let plan = dedup_plan(schema, vec![]);
let opt = PartitionSplit::default();
let opt = PartitionSplit;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -145,7 +145,7 @@ mod tests {
let chunk3 = chunk(3).with_dummy_parquet_file();
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = PartitionSplit::default();
let opt = PartitionSplit;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -176,7 +176,7 @@ mod tests {
let chunk6 = chunk(6).with_dummy_parquet_file().with_partition_id(1);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3, chunk4, chunk5, chunk6]);
let opt = PartitionSplit::default();
let opt = PartitionSplit;
let mut config = ConfigOptions::default();
config.execution.target_partitions = 2;
insta::assert_yaml_snapshot!(
@ -210,7 +210,7 @@ mod tests {
let chunk3 = chunk(3).with_partition_id(3);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = PartitionSplit::default();
let opt = PartitionSplit;
let mut config = ConfigOptions::default();
config.extensions.insert(IoxConfigExt {
max_dedup_partition_split: 2,

View File

@ -73,7 +73,7 @@ mod tests {
fn test_no_chunks() {
let schema = chunk(1).schema().clone();
let plan = dedup_plan(schema, vec![]);
let opt = RemoveDedup::default();
let opt = RemoveDedup;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -93,7 +93,7 @@ mod tests {
let chunk1 = chunk(1).with_may_contain_pk_duplicates(false);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1]);
let opt = RemoveDedup::default();
let opt = RemoveDedup;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -115,7 +115,7 @@ mod tests {
let chunk1 = chunk(1).with_may_contain_pk_duplicates(true);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1]);
let opt = RemoveDedup::default();
let opt = RemoveDedup;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -139,7 +139,7 @@ mod tests {
let chunk2 = chunk(2).with_may_contain_pk_duplicates(false);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2]);
let opt = RemoveDedup::default();
let opt = RemoveDedup;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -112,7 +112,7 @@ mod tests {
fn test_no_chunks() {
let schema = chunk(1).schema().clone();
let plan = dedup_plan(schema, vec![]);
let opt = TimeSplit::default();
let opt = TimeSplit;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -137,7 +137,7 @@ mod tests {
.with_timestamp_min_max(8, 9);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = TimeSplit::default();
let opt = TimeSplit;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -176,7 +176,7 @@ mod tests {
.with_timestamp_min_max(0, 0);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3, chunk4, chunk5, chunk6]);
let opt = TimeSplit::default();
let opt = TimeSplit;
let mut config = ConfigOptions::default();
config.execution.target_partitions = 2;
insta::assert_yaml_snapshot!(
@ -210,7 +210,7 @@ mod tests {
let chunk3 = chunk(3).with_timestamp_min_max(3, 3);
let schema = chunk1.schema().clone();
let plan = dedup_plan(schema, vec![chunk1, chunk2, chunk3]);
let opt = TimeSplit::default();
let opt = TimeSplit;
let mut config = ConfigOptions::default();
config.extensions.insert(IoxConfigExt {
max_dedup_time_split: 2,

View File

@ -30,17 +30,17 @@ pub fn register_iox_physical_optimizers(state: SessionState) -> SessionState {
// prepend IOx-specific rules to DataFusion builtins
// The optimizer rules have to be done in this order
let mut optimizers: Vec<Arc<dyn PhysicalOptimizerRule + Sync + Send>> = vec![
Arc::new(PartitionSplit::default()),
Arc::new(TimeSplit::default()),
Arc::new(RemoveDedup::default()),
Arc::new(CombineChunks::default()),
Arc::new(DedupNullColumns::default()),
Arc::new(DedupSortOrder::default()),
Arc::new(PredicatePushdown::default()),
Arc::new(ProjectionPushdown::default()),
Arc::new(ParquetSortness::default()) as _,
Arc::new(NestedUnion::default()),
Arc::new(OneUnion::default()),
Arc::new(PartitionSplit),
Arc::new(TimeSplit),
Arc::new(RemoveDedup),
Arc::new(CombineChunks),
Arc::new(DedupNullColumns),
Arc::new(DedupSortOrder),
Arc::new(PredicatePushdown),
Arc::new(ProjectionPushdown),
Arc::new(ParquetSortness) as _,
Arc::new(NestedUnion),
Arc::new(OneUnion),
];
optimizers.append(&mut state.physical_optimizers().to_vec());

View File

@ -190,7 +190,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -215,7 +215,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -245,7 +245,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -280,7 +280,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -328,7 +328,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -358,7 +358,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -390,7 +390,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -429,7 +429,7 @@ mod tests {
)
.unwrap(),
);
let opt = PredicatePushdown::default();
let opt = PredicatePushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -457,7 +457,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -496,7 +496,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -535,7 +535,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -564,7 +564,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -593,7 +593,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -619,7 +619,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -648,7 +648,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -685,7 +685,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -756,7 +756,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -800,7 +800,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -833,7 +833,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -867,7 +867,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -899,7 +899,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -939,7 +939,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -980,7 +980,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -1025,7 +1025,7 @@ mod tests {
assert_unknown_partitioning(plan.output_partitioning(), 2);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -1067,7 +1067,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -1113,7 +1113,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -1151,7 +1151,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -1197,7 +1197,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -1253,7 +1253,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -1289,7 +1289,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -1359,7 +1359,7 @@ mod tests {
)
.unwrap(),
);
let opt = ProjectionPushdown::default();
let opt = ProjectionPushdown;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -212,7 +212,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -248,7 +248,7 @@ mod tests {
ordering(["col2", "col1"], &schema),
true,
));
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -287,7 +287,7 @@ mod tests {
assert_unknown_partitioning(plan.output_partitioning(), 2);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
let test = OptimizationTest::new(plan, opt);
insta::assert_yaml_snapshot!(
test,
@ -325,7 +325,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -360,7 +360,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -395,7 +395,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -430,7 +430,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
let mut config = ConfigOptions::default();
config.extensions.insert(IoxConfigExt {
max_parquet_fanout: 2,
@ -459,7 +459,7 @@ mod tests {
SortExec::new(ordering(["col2", "col1"], &schema), Arc::new(inner))
.with_fetch(Some(42)),
);
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -490,7 +490,7 @@ mod tests {
infinite_source: false,
};
let plan = Arc::new(ParquetExec::new(base_config, None, None));
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -523,7 +523,7 @@ mod tests {
Arc::new(SortExec::new(ordering(["col2", "col1"], &schema), plan).with_fetch(Some(42)));
let plan =
Arc::new(SortExec::new(ordering(["col1", "col2"], &schema), plan).with_fetch(Some(42)));
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -560,7 +560,7 @@ mod tests {
Arc::new(SortExec::new(ordering(["col1", "col2"], &schema), plan).with_fetch(Some(42)));
let plan =
Arc::new(SortExec::new(ordering(["col2", "col1"], &schema), plan).with_fetch(Some(42)));
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -602,7 +602,7 @@ mod tests {
ordering(["col2", "col1"], &schema),
true,
));
let opt = ParquetSortness::default();
let opt = ParquetSortness;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -88,7 +88,7 @@ mod tests {
#[test]
fn test_union_not_nested() {
let plan = Arc::new(UnionExec::new(vec![other_node()]));
let opt = NestedUnion::default();
let opt = NestedUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -110,7 +110,7 @@ mod tests {
Arc::new(UnionExec::new(vec![other_node(), other_node()])),
other_node(),
]));
let opt = NestedUnion::default();
let opt = NestedUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -140,7 +140,7 @@ mod tests {
])),
other_node(),
]));
let opt = NestedUnion::default();
let opt = NestedUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -165,7 +165,7 @@ mod tests {
#[test]
fn test_other_node() {
let plan = other_node();
let opt = NestedUnion::default();
let opt = NestedUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -70,7 +70,7 @@ mod tests {
#[test]
fn test_union_one() {
let plan = Arc::new(UnionExec::new(vec![other_node()]));
let opt = OneUnion::default();
let opt = OneUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -88,7 +88,7 @@ mod tests {
#[test]
fn test_union_two() {
let plan = Arc::new(UnionExec::new(vec![other_node(), other_node()]));
let opt = OneUnion::default();
let opt = OneUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"
@ -109,7 +109,7 @@ mod tests {
#[test]
fn test_other_node() {
let plan = other_node();
let opt = OneUnion::default();
let opt = OneUnion;
insta::assert_yaml_snapshot!(
OptimizationTest::new(plan, opt),
@r###"

View File

@ -85,7 +85,7 @@ mod tests {
use rand::prelude::*;
fn make_rng() -> StdRng {
let seed = rand::rngs::OsRng::default().next_u64();
let seed = rand::rngs::OsRng.next_u64();
println!("Seed: {seed}");
StdRng::seed_from_u64(seed)
}

View File

@ -346,7 +346,7 @@ mod tests {
use rand::prelude::*;
fn make_rng() -> StdRng {
let seed = rand::rngs::OsRng::default().next_u64();
let seed = rand::rngs::OsRng.next_u64();
println!("Seed: {seed}");
StdRng::seed_from_u64(seed)
}

View File

@ -25,7 +25,7 @@ use schema::Projection;
use std::{collections::BTreeMap, num::NonZeroU64, ops::Range, sync::Arc};
fn make_rng() -> StdRng {
let seed = rand::rngs::OsRng::default().next_u64();
let seed = rand::rngs::OsRng.next_u64();
println!("Seed: {seed}");
StdRng::seed_from_u64(seed)
}

View File

@ -85,7 +85,7 @@ mod tests {
#[tokio::test]
async fn test_parse_v1_always_errors() {
let unifier = MultiTenantRequestUnifier::default();
let unifier = MultiTenantRequestUnifier;
let got = unifier.parse_v1(&Request::default()).await;
assert_matches!(got, Err(Error::NoHandler));
@ -100,7 +100,7 @@ mod tests {
paste::paste! {
#[tokio::test]
async fn [<test_parse_v2_ $name>]() {
let unifier = MultiTenantRequestUnifier::default();
let unifier = MultiTenantRequestUnifier;
let query = $query_string;
let request = Request::builder()