diff --git a/Cargo.lock b/Cargo.lock index cdfa79410491f..279c4c1c2d563 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" dependencies = [ "backtrace", ] @@ -8917,18 +8917,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", diff --git a/src/connector/build.rs b/src/connector/build.rs index 6439fcf00f932..3ace772d46039 100644 --- a/src/connector/build.rs +++ b/src/connector/build.rs @@ -17,7 +17,7 @@ fn main() { println!("cargo:rerun-if-changed={}", proto_dir); - let proto_files = vec!["recursive"]; + let proto_files = ["recursive"]; let protos: Vec = proto_files .iter() .map(|f| format!("{}/{}.proto", proto_dir, f)) diff --git a/src/frontend/src/binder/expr/function.rs b/src/frontend/src/binder/expr/function.rs index 4cb703906bf8c..51b18b0837584 100644 --- a/src/frontend/src/binder/expr/function.rs +++ b/src/frontend/src/binder/expr/function.rs @@ -185,10 +185,16 @@ impl Binder { } }; - let ast::FunctionArgExpr::Expr(ast::Expr::LambdaFunction { args: lambda_args, body: lambda_body }) = lambda.get_expr() else { + let ast::FunctionArgExpr::Expr(ast::Expr::LambdaFunction { + args: lambda_args, + body: lambda_body, + }) = lambda.get_expr() + else { return Err(ErrorCode::BindError( - "The `lambda` argument for `array_transform` should be a lambda function".to_string() - ).into()); + "The `lambda` argument for `array_transform` should be a lambda function" + .to_string(), + ) + .into()); }; let [lambda_arg] = <[Ident; 1]>::try_from(lambda_args).map_err(|args| -> RwError { diff --git a/src/jni_core/src/lib.rs b/src/jni_core/src/lib.rs index 62625e14d21fe..be350ae57a460 100644 --- a/src/jni_core/src/lib.rs +++ b/src/jni_core/src/lib.rs @@ -13,7 +13,6 @@ // limitations under the License. #![feature(error_generic_member_access)] -#![feature(provide_any)] #![feature(lazy_cell)] #![feature(once_cell_try)] #![feature(type_alias_impl_trait)] diff --git a/src/storage/src/hummock/event_handler/hummock_event_handler.rs b/src/storage/src/hummock/event_handler/hummock_event_handler.rs index 31899737f4ab8..d9e25ebe46555 100644 --- a/src/storage/src/hummock/event_handler/hummock_event_handler.rs +++ b/src/storage/src/hummock/event_handler/hummock_event_handler.rs @@ -511,7 +511,7 @@ impl HummockEventHandler { UploaderEvent::ImmMerged(merge_output) => { // update read version for corresponding table shards let read_guard = self.read_version_mapping.read(); - read_guard.get(&merge_output.table_id).map_or((), |shards| { + if let Some(shards) = read_guard.get(&merge_output.table_id) { shards.get(&merge_output.instance_id).map_or_else( || { warn!( @@ -525,7 +525,7 @@ impl HummockEventHandler { )); }, ) - }); + } } } } diff --git a/src/storage/src/monitor/traced_store.rs b/src/storage/src/monitor/traced_store.rs index efa4b1111dcb5..505c0460552a7 100644 --- a/src/storage/src/monitor/traced_store.rs +++ b/src/storage/src/monitor/traced_store.rs @@ -104,8 +104,7 @@ impl TracedStateStore { } } -type TracedStateStoreIterStream = - impl StateStoreIterItemStream; +type TracedStateStoreIterStream = impl StateStoreIterItemStream; impl LocalStateStore for TracedStateStore { type IterStream<'a> = impl StateStoreIterItemStream + 'a; diff --git a/src/stream/src/executor/over_window/general.rs b/src/stream/src/executor/over_window/general.rs index ba995f7e7c3cb..091e199d7b52a 100644 --- a/src/stream/src/executor/over_window/general.rs +++ b/src/stream/src/executor/over_window/general.rs @@ -307,7 +307,7 @@ impl OverWindowExecutor { match record { Record::Insert { new_row } => { let part_key = this.get_partition_key(new_row).into(); - let part_delta = deltas.entry(part_key).or_insert(PartitionDelta::new()); + let part_delta = deltas.entry(part_key).or_default(); part_delta.insert( this.row_to_cache_key(new_row)?, Change::Insert(new_row.into_owned_row()), @@ -315,7 +315,7 @@ impl OverWindowExecutor { } Record::Delete { old_row } => { let part_key = this.get_partition_key(old_row).into(); - let part_delta = deltas.entry(part_key).or_insert(PartitionDelta::new()); + let part_delta = deltas.entry(part_key).or_default(); part_delta.insert(this.row_to_cache_key(old_row)?, Change::Delete); } Record::Update { old_row, new_row } => { @@ -325,15 +325,13 @@ impl OverWindowExecutor { let new_state_key = this.row_to_cache_key(new_row)?; if old_part_key == new_part_key && old_state_key == new_state_key { // not a key-change update - let part_delta = - deltas.entry(old_part_key).or_insert(PartitionDelta::new()); + let part_delta = deltas.entry(old_part_key).or_default(); part_delta.insert(old_state_key, Change::Insert(new_row.into_owned_row())); } else if old_part_key == new_part_key { // order-change update, split into delete + insert, will be merged after // building changes key_change_updated_pks.insert(this.get_input_pk(old_row)); - let part_delta = - deltas.entry(old_part_key).or_insert(PartitionDelta::new()); + let part_delta = deltas.entry(old_part_key).or_default(); part_delta.insert(old_state_key, Change::Delete); part_delta.insert(new_state_key, Change::Insert(new_row.into_owned_row())); } else { @@ -341,11 +339,9 @@ impl OverWindowExecutor { // NOTE(rc): Since we append partition key to logical pk, we can't merge the // delete + insert back to update later. // TODO: IMO this behavior is problematic. Deep discussion is needed. - let old_part_delta = - deltas.entry(old_part_key).or_insert(PartitionDelta::new()); + let old_part_delta = deltas.entry(old_part_key).or_default(); old_part_delta.insert(old_state_key, Change::Delete); - let new_part_delta = - deltas.entry(new_part_key).or_insert(PartitionDelta::new()); + let new_part_delta = deltas.entry(new_part_key).or_default(); new_part_delta .insert(new_state_key, Change::Insert(new_row.into_owned_row())); } diff --git a/src/stream/src/executor/over_window/over_partition.rs b/src/stream/src/executor/over_window/over_partition.rs index 28d7ce7d2ef99..ab785acd9b681 100644 --- a/src/stream/src/executor/over_window/over_partition.rs +++ b/src/stream/src/executor/over_window/over_partition.rs @@ -1083,7 +1083,7 @@ mod find_affected_ranges_tests { ) { result .into_iter() - .zip_eq(expected.into_iter()) + .zip_eq(expected) .for_each(|(result, expected)| { assert_eq!( result.0.as_normal_expect().pk.0, diff --git a/src/stream/src/executor/source/source_executor.rs b/src/stream/src/executor/source/source_executor.rs index 44243334e1d18..7f8cd9a66c6a9 100644 --- a/src/stream/src/executor/source/source_executor.rs +++ b/src/stream/src/executor/source/source_executor.rs @@ -257,7 +257,7 @@ impl SourceExecutor { // fetch the newest offset, either it's in cache (before barrier) // or in state table (just after barrier) let target_state = if core.state_cache.is_empty() { - for ele in split_info.iter_mut() { + for ele in &mut *split_info { if let Some(recover_state) = core .split_state_store .try_recover_from_state_store(ele)