From b989b8dcb8caac5bb9272d8413fdc9896a4d9ee5 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Fri, 10 Jun 2022 00:26:39 +0800 Subject: [PATCH] build: bump toolchain to 2022-06-09 Signed-off-by: TennyZhuang --- rust-toolchain | 2 +- src/connector/src/kinesis/source/reader.rs | 6 ++---- src/expr/src/vector_op/agg/general_sorted_grouper.rs | 2 +- src/expr/src/vector_op/ascii.rs | 2 +- src/frontend/src/binder/expr/mod.rs | 2 +- src/frontend/src/expr/function_call.rs | 2 +- src/frontend/src/scheduler/distributed/stage.rs | 2 +- src/frontend/src/scheduler/local.rs | 2 +- src/frontend/test_runner/src/lib.rs | 4 ++-- src/meta/src/barrier/recovery.rs | 4 ++-- src/prost/helpers/src/generate.rs | 4 ++-- src/sqlparser/src/parser.rs | 2 +- src/storage/src/hummock/compactor_tests.rs | 5 ++--- src/storage/src/hummock/iterator/forward_user.rs | 3 +-- .../src/executor/managed_state/aggregation/string_agg.rs | 5 ++--- 15 files changed, 21 insertions(+), 26 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index bab7dd315e346..7e041bcf7fafa 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-05-24 +nightly-2022-06-09 diff --git a/src/connector/src/kinesis/source/reader.rs b/src/connector/src/kinesis/source/reader.rs index 81f485cdefcd7..7394ac5bb49db 100644 --- a/src/connector/src/kinesis/source/reader.rs +++ b/src/connector/src/kinesis/source/reader.rs @@ -150,13 +150,11 @@ impl KinesisSplitReader { async fn get_records( &mut self, ) -> core::result::Result> { - let resp = self - .client + self.client .get_records() .set_shard_iterator(self.shard_iter.take()) .send() - .await; - resp + .await } } diff --git a/src/expr/src/vector_op/agg/general_sorted_grouper.rs b/src/expr/src/vector_op/agg/general_sorted_grouper.rs index e54a624bc502d..9f5bb75933769 100644 --- a/src/expr/src/vector_op/agg/general_sorted_grouper.rs +++ b/src/expr/src/vector_op/agg/general_sorted_grouper.rs @@ -111,7 +111,7 @@ impl EqGroups { use std::collections::BinaryHeap; let mut heap = BinaryHeap::new(); for (ci, column) in columns.iter().enumerate() { - if let Some(ri) = column.starting_indices().get(0) { + if let Some(ri) = column.starting_indices().first() { heap.push(Reverse((ri, ci, 0))); } } diff --git a/src/expr/src/vector_op/ascii.rs b/src/expr/src/vector_op/ascii.rs index 0156325399b5a..2fbb629144e0f 100644 --- a/src/expr/src/vector_op/ascii.rs +++ b/src/expr/src/vector_op/ascii.rs @@ -16,7 +16,7 @@ use crate::Result; #[inline(always)] pub fn ascii(s: &str) -> Result { - Ok(s.as_bytes().get(0).map(|x| *x as i32).unwrap_or(0)) + Ok(s.as_bytes().first().map(|x| *x as i32).unwrap_or(0)) } #[cfg(test)] diff --git a/src/frontend/src/binder/expr/mod.rs b/src/frontend/src/binder/expr/mod.rs index 49d49b17f9e10..fb5fcfbbcf262 100644 --- a/src/frontend/src/binder/expr/mod.rs +++ b/src/frontend/src/binder/expr/mod.rs @@ -204,7 +204,7 @@ impl Binder { if return_type.is_numeric() { return Ok(expr); } - return Err(ErrorCode::InvalidInputSyntax(format!("+ {:?}", return_type)).into()); + Err(ErrorCode::InvalidInputSyntax(format!("+ {:?}", return_type)).into()) } pub(super) fn bind_trim( diff --git a/src/frontend/src/expr/function_call.rs b/src/frontend/src/expr/function_call.rs index 871227b4f55a7..09823d6733d7d 100644 --- a/src/frontend/src/expr/function_call.rs +++ b/src/frontend/src/expr/function_call.rs @@ -57,7 +57,7 @@ impl std::fmt::Debug for FunctionCall { ExprType::Cast => { assert_eq!(self.inputs.len(), 1); self.inputs[0].fmt(f)?; - return write!(f, "::{:?}", self.return_type); + write!(f, "::{:?}", self.return_type) } ExprType::Add => debug_binary_op(f, "+", &self.inputs), ExprType::Subtract => debug_binary_op(f, "-", &self.inputs), diff --git a/src/frontend/src/scheduler/distributed/stage.rs b/src/frontend/src/scheduler/distributed/stage.rs index 38b4118c75da2..73230e178b68d 100644 --- a/src/frontend/src/scheduler/distributed/stage.rs +++ b/src/frontend/src/scheduler/distributed/stage.rs @@ -393,7 +393,7 @@ impl StageRunner { let children = execution_plan_node .children .iter() - .map(|e| self.convert_plan_node(&*e, task_id)) + .map(|e| self.convert_plan_node(e, task_id)) .collect(); PlanNodeProst { diff --git a/src/frontend/src/scheduler/local.rs b/src/frontend/src/scheduler/local.rs index ca988895759fb..122876a941014 100644 --- a/src/frontend/src/scheduler/local.rs +++ b/src/frontend/src/scheduler/local.rs @@ -114,7 +114,7 @@ impl LocalQueryExecution { let children = execution_plan_node .children .iter() - .map(|e| self.convert_plan_node(&*e)) + .map(|e| self.convert_plan_node(e)) .collect::>>()?; Ok(PlanNodeProst { diff --git a/src/frontend/test_runner/src/lib.rs b/src/frontend/test_runner/src/lib.rs index 45bb52493b316..9c62a42065c41 100644 --- a/src/frontend/test_runner/src/lib.rs +++ b/src/frontend/test_runner/src/lib.rs @@ -490,12 +490,12 @@ fn check_err(ctx: &str, expected_err: &Option, actual_err: &Option TokenStream2 { } } - return quote! { + quote! { #[inline(always)] pub fn #getter_fn_name(&self) -> &#ty { &self.#field_name } - }; + } } diff --git a/src/sqlparser/src/parser.rs b/src/sqlparser/src/parser.rs index 01cbcd2313c86..0bbada7b86260 100644 --- a/src/sqlparser/src/parser.rs +++ b/src/sqlparser/src/parser.rs @@ -1356,7 +1356,7 @@ impl Parser { let all = self.parse_keyword(Keyword::ALL); let distinct = self.parse_keyword(Keyword::DISTINCT); if all && distinct { - return parser_err!("Cannot specify both ALL and DISTINCT".to_string()); + parser_err!("Cannot specify both ALL and DISTINCT".to_string()) } else { Ok(distinct) } diff --git a/src/storage/src/hummock/compactor_tests.rs b/src/storage/src/hummock/compactor_tests.rs index 0e7a31b961713..6a3586e853e82 100644 --- a/src/storage/src/hummock/compactor_tests.rs +++ b/src/storage/src/hummock/compactor_tests.rs @@ -48,15 +48,14 @@ mod tests { ..Default::default() }); let sstable_store = mock_sstable_store(); - let storage = HummockStorage::with_default_stats( + HummockStorage::with_default_stats( options.clone(), sstable_store, hummock_meta_client.clone(), Arc::new(StateStoreMetrics::unused()), ) .await - .unwrap(); - storage + .unwrap() } #[tokio::test] diff --git a/src/storage/src/hummock/iterator/forward_user.rs b/src/storage/src/hummock/iterator/forward_user.rs index 9322ac1d74304..d19ffbe641f5f 100644 --- a/src/storage/src/hummock/iterator/forward_user.rs +++ b/src/storage/src/hummock/iterator/forward_user.rs @@ -249,8 +249,7 @@ impl UserIterator { // Handle multi-version self.last_key.clear(); // Handle range scan when key > end_key - let res = self.next().await; - res + self.next().await } /// Indicates whether the iterator can be used. diff --git a/src/stream/src/executor/managed_state/aggregation/string_agg.rs b/src/stream/src/executor/managed_state/aggregation/string_agg.rs index cd1a763dc356d..761322edb0729 100644 --- a/src/stream/src/executor/managed_state/aggregation/string_agg.rs +++ b/src/stream/src/executor/managed_state/aggregation/string_agg.rs @@ -291,7 +291,7 @@ mod tests { .map(|(ord, idx)| OrderPair::new(idx, ord)) .collect::>(); let sort_key_serializer = OrderedArraysSerializer::new(order_pairs); - let managed_state = ManagedStringAggState::new( + ManagedStringAggState::new( keyspace.clone(), row_count, sort_key_indices, @@ -300,8 +300,7 @@ mod tests { sort_key_serializer, ) .await - .unwrap(); - managed_state + .unwrap() } #[tokio::test]