Skip to content

chore: udapte Rust toolchain to 2024-10-19 #4857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: clippy
  • Loading branch information
v0y4g3r committed Oct 18, 2024
commit 2ac380c85cbbf90753da03881d141fff76da1a8f
2 changes: 1 addition & 1 deletion src/common/meta/src/key/catalog_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct CatalogNameKey<'a> {
pub catalog: &'a str,
}

impl<'a> Default for CatalogNameKey<'a> {
impl Default for CatalogNameKey<'_> {
fn default() -> Self {
Self {
catalog: DEFAULT_CATALOG_NAME,
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/key/datanode_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl DatanodeTableKey {
}
}

impl<'a> MetadataKey<'a, DatanodeTableKey> for DatanodeTableKey {
impl MetadataKey<'_, DatanodeTableKey> for DatanodeTableKey {
fn to_bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
}
Expand Down
6 changes: 3 additions & 3 deletions src/common/meta/src/key/flow/flow_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ lazy_static! {
/// The layout: `__flow/info/{flow_id}`.
pub struct FlowInfoKey(FlowScoped<FlowInfoKeyInner>);

pub type FlowInfoDecodeResult = Result<Option<DeserializedValueWithBytes<FlowInfoValue>>>;

impl<'a> MetadataKey<'a, FlowInfoKey> for FlowInfoKey {
fn to_bytes(&self) -> Vec<u8> {
self.0.to_bytes()
Expand Down Expand Up @@ -203,9 +205,7 @@ impl FlowInfoManager {
flow_value: &FlowInfoValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<FlowInfoValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> FlowInfoDecodeResult,
)> {
let key = FlowInfoKey::new(flow_id).to_bytes();
let txn = Txn::put_if_not_exists(key.clone(), flow_value.try_as_raw_value()?);
Expand Down
6 changes: 3 additions & 3 deletions src/common/meta/src/key/flow/flow_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ lazy_static! {
/// The layout: `__flow/name/{catalog_name}/{flow_name}`.
pub struct FlowNameKey<'a>(FlowScoped<FlowNameKeyInner<'a>>);

pub type FlowNameDecodeResult = Result<Option<DeserializedValueWithBytes<FlowNameValue>>>;

#[allow(dead_code)]
impl<'a> FlowNameKey<'a> {
/// Returns the [FlowNameKey]
Expand Down Expand Up @@ -223,9 +225,7 @@ impl FlowNameManager {
flow_id: FlowId,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<FlowNameValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> FlowNameDecodeResult,
)> {
let key = FlowNameKey::new(catalog_name, flow_name);
let raw_key = key.to_bytes();
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/key/node_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl NodeAddressValue {
}
}

impl<'a> MetadataKey<'a, NodeAddressKey> for NodeAddressKey {
impl MetadataKey<'_, NodeAddressKey> for NodeAddressKey {
fn to_bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/key/schema_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct SchemaNameKey<'a> {
pub schema: &'a str,
}

impl<'a> Default for SchemaNameKey<'a> {
impl Default for SchemaNameKey<'_> {
fn default() -> Self {
Self {
catalog: DEFAULT_CATALOG_NAME,
Expand Down
11 changes: 4 additions & 7 deletions src/common/meta/src/key/table_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Display for TableInfoKey {
}
}

impl<'a> MetadataKey<'a, TableInfoKey> for TableInfoKey {
impl MetadataKey<'_, TableInfoKey> for TableInfoKey {
fn to_bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
}
Expand Down Expand Up @@ -132,6 +132,7 @@ pub type TableInfoManagerRef = Arc<TableInfoManager>;
pub struct TableInfoManager {
kv_backend: KvBackendRef,
}
pub type TableInfoDecodeResult = Result<Option<DeserializedValueWithBytes<TableInfoValue>>>;

impl TableInfoManager {
pub fn new(kv_backend: KvBackendRef) -> Self {
Expand All @@ -145,9 +146,7 @@ impl TableInfoManager {
table_info_value: &TableInfoValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<TableInfoValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> TableInfoDecodeResult,
)> {
let key = TableInfoKey::new(table_id);
let raw_key = key.to_bytes();
Expand All @@ -169,9 +168,7 @@ impl TableInfoManager {
new_table_info_value: &TableInfoValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<TableInfoValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> TableInfoDecodeResult,
)> {
let key = TableInfoKey::new(table_id);
let raw_key = key.to_bytes();
Expand Down
12 changes: 5 additions & 7 deletions src/common/meta/src/key/table_route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl LogicalTableRouteValue {
}
}

impl<'a> MetadataKey<'a, TableRouteKey> for TableRouteKey {
impl MetadataKey<'_, TableRouteKey> for TableRouteKey {
fn to_bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
}
Expand Down Expand Up @@ -472,6 +472,8 @@ pub struct TableRouteStorage {
kv_backend: KvBackendRef,
}

pub type TableRouteValueDecodeResult = Result<Option<DeserializedValueWithBytes<TableRouteValue>>>;

impl TableRouteStorage {
pub fn new(kv_backend: KvBackendRef) -> Self {
Self { kv_backend }
Expand All @@ -485,9 +487,7 @@ impl TableRouteStorage {
table_route_value: &TableRouteValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<TableRouteValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> TableRouteValueDecodeResult,
)> {
let key = TableRouteKey::new(table_id);
let raw_key = key.to_bytes();
Expand All @@ -510,9 +510,7 @@ impl TableRouteStorage {
new_table_route_value: &TableRouteValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<TableRouteValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> TableRouteValueDecodeResult,
)> {
let key = TableRouteKey::new(table_id);
let raw_key = key.to_bytes();
Expand Down
12 changes: 5 additions & 7 deletions src/common/meta/src/key/view_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Display for ViewInfoKey {
}
}

impl<'a> MetadataKey<'a, ViewInfoKey> for ViewInfoKey {
impl MetadataKey<'_, ViewInfoKey> for ViewInfoKey {
fn to_bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
}
Expand Down Expand Up @@ -139,6 +139,8 @@ pub struct ViewInfoManager {

pub type ViewInfoManagerRef = Arc<ViewInfoManager>;

pub type ViewInfoValueDecodeResult = Result<Option<DeserializedValueWithBytes<ViewInfoValue>>>;

impl ViewInfoManager {
pub fn new(kv_backend: KvBackendRef) -> Self {
Self { kv_backend }
Expand All @@ -151,9 +153,7 @@ impl ViewInfoManager {
view_info_value: &ViewInfoValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<ViewInfoValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> ViewInfoValueDecodeResult,
)> {
let key = ViewInfoKey::new(view_id);
let raw_key = key.to_bytes();
Expand All @@ -175,9 +175,7 @@ impl ViewInfoManager {
new_view_info_value: &ViewInfoValue,
) -> Result<(
Txn,
impl FnOnce(
&mut TxnOpGetResponseSet,
) -> Result<Option<DeserializedValueWithBytes<ViewInfoValue>>>,
impl FnOnce(&mut TxnOpGetResponseSet) -> ViewInfoValueDecodeResult,
)> {
let key = ViewInfoKey::new(view_id);
let raw_key = key.to_bytes();
Expand Down
4 changes: 2 additions & 2 deletions src/common/meta/src/lock_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub enum CatalogLock<'a> {
Write(&'a str),
}

impl<'a> Display for CatalogLock<'a> {
impl Display for CatalogLock<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let key = match self {
CatalogLock::Read(s) => s,
Expand All @@ -44,7 +44,7 @@ impl<'a> Display for CatalogLock<'a> {
}
}

impl<'a> From<CatalogLock<'a>> for StringKey {
impl From<CatalogLock<'_>> for StringKey {
fn from(value: CatalogLock) -> Self {
match value {
CatalogLock::Write(_) => StringKey::Exclusive(value.to_string()),
Expand Down
2 changes: 1 addition & 1 deletion src/common/procedure/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct ParsedKey<'a> {
key_type: KeyType,
}

impl<'a> fmt::Display for ParsedKey<'a> {
impl fmt::Display for ParsedKey<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
Expand Down
2 changes: 1 addition & 1 deletion src/common/recordbatch/src/recordbatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl<'a> RecordBatchRowIterator<'a> {
}
}

impl<'a> Iterator for RecordBatchRowIterator<'a> {
impl Iterator for RecordBatchRowIterator<'_> {
type Item = Vec<Value>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
8 changes: 4 additions & 4 deletions src/datatypes/src/scalars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Scalar for bool {
}
}

impl<'a> ScalarRef<'a> for bool {
impl ScalarRef<'_> for bool {
type ScalarType = bool;

#[inline]
Expand Down Expand Up @@ -273,7 +273,7 @@ impl Scalar for Date {
}
}

impl<'a> ScalarRef<'a> for Date {
impl ScalarRef<'_> for Date {
type ScalarType = Date;

fn to_owned_scalar(&self) -> Self::ScalarType {
Expand All @@ -294,7 +294,7 @@ impl Scalar for Decimal128 {
}
}

impl<'a> ScalarRef<'a> for Decimal128 {
impl ScalarRef<'_> for Decimal128 {
type ScalarType = Decimal128;

fn to_owned_scalar(&self) -> Self::ScalarType {
Expand All @@ -315,7 +315,7 @@ impl Scalar for DateTime {
}
}

impl<'a> ScalarRef<'a> for DateTime {
impl ScalarRef<'_> for DateTime {
type ScalarType = DateTime;

fn to_owned_scalar(&self) -> Self::ScalarType {
Expand Down
20 changes: 10 additions & 10 deletions src/datatypes/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ macro_rules! impl_as_for_value_ref {
};
}

impl<'a> ValueRef<'a> {
impl ValueRef<'_> {
define_data_type_func!(ValueRef);

/// Returns true if this is null.
Expand Down Expand Up @@ -1214,13 +1214,13 @@ impl<'a> ValueRef<'a> {
}
}

impl<'a> PartialOrd for ValueRef<'a> {
impl PartialOrd for ValueRef<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> Ord for ValueRef<'a> {
impl Ord for ValueRef<'_> {
fn cmp(&self, other: &Self) -> Ordering {
impl_ord_for_value_like!(ValueRef, self, other)
}
Expand Down Expand Up @@ -1347,7 +1347,7 @@ pub enum ListValueRef<'a> {
Ref { val: &'a ListValue },
}

impl<'a> ListValueRef<'a> {
impl ListValueRef<'_> {
/// Convert self to [Value]. This method would clone the underlying data.
fn to_value(self) -> Value {
match self {
Expand All @@ -1365,7 +1365,7 @@ impl<'a> ListValueRef<'a> {
}
}

impl<'a> Serialize for ListValueRef<'a> {
impl Serialize for ListValueRef<'_> {
fn serialize<S: Serializer>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> {
match self {
ListValueRef::Indexed { vector, idx } => match vector.get(*idx) {
Expand All @@ -1377,28 +1377,28 @@ impl<'a> Serialize for ListValueRef<'a> {
}
}

impl<'a> PartialEq for ListValueRef<'a> {
impl PartialEq for ListValueRef<'_> {
fn eq(&self, other: &Self) -> bool {
self.to_value().eq(&other.to_value())
}
}

impl<'a> Eq for ListValueRef<'a> {}
impl Eq for ListValueRef<'_> {}

impl<'a> Ord for ListValueRef<'a> {
impl Ord for ListValueRef<'_> {
fn cmp(&self, other: &Self) -> Ordering {
// Respect the order of `Value` by converting into value before comparison.
self.to_value().cmp(&other.to_value())
}
}

impl<'a> PartialOrd for ListValueRef<'a> {
impl PartialOrd for ListValueRef<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> ValueRef<'a> {
impl ValueRef<'_> {
/// Returns the size of the underlying data in bytes,
/// The size is estimated and only considers the data size.
pub fn data_size(&self) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion src/datatypes/src/vectors/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub struct Decimal128Iter<'a> {
iter: ArrayIter<&'a Decimal128Array>,
}

impl<'a> Iterator for Decimal128Iter<'a> {
impl Iterator for Decimal128Iter<'_> {
type Item = Option<Decimal128>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/datatypes/src/vectors/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub struct PrimitiveIter<'a, T: LogicalPrimitiveType> {
iter: ArrayIter<&'a PrimitiveArray<T::ArrowPrimitive>>,
}

impl<'a, T: LogicalPrimitiveType> Iterator for PrimitiveIter<'a, T> {
impl<T: LogicalPrimitiveType> Iterator for PrimitiveIter<'_, T> {
type Item = Option<T::Wrapper>;

fn next(&mut self) -> Option<Option<T::Wrapper>> {
Expand Down
6 changes: 3 additions & 3 deletions src/flow/src/compute/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct Context<'referred, 'df> {
pub err_collector: ErrCollector,
}

impl<'referred, 'df> Drop for Context<'referred, 'df> {
impl Drop for Context<'_, '_> {
fn drop(&mut self) {
for bundle in std::mem::take(&mut self.input_collection)
.into_values()
Expand Down Expand Up @@ -92,7 +92,7 @@ impl<'referred, 'df> Drop for Context<'referred, 'df> {
}
}

impl<'referred, 'df> Context<'referred, 'df> {
impl Context<'_, '_> {
pub fn insert_global(&mut self, id: GlobalId, collection: CollectionBundle) {
self.input_collection.insert(id, collection);
}
Expand Down Expand Up @@ -120,7 +120,7 @@ impl<'referred, 'df> Context<'referred, 'df> {
}
}

impl<'referred, 'df> Context<'referred, 'df> {
impl Context<'_, '_> {
/// Like `render_plan` but in Batch Mode
pub fn render_plan_batch(&mut self, plan: TypedPlan) -> Result<CollectionBundle<Batch>, Error> {
match plan.plan {
Expand Down
2 changes: 1 addition & 1 deletion src/flow/src/compute/render/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::plan::TypedPlan;
use crate::repr::{self, DiffRow, KeyValDiffRow, Row};
use crate::utils::ArrangeHandler;

impl<'referred, 'df> Context<'referred, 'df> {
impl Context<'_, '_> {
/// Like `render_mfp` but in batch mode
pub fn render_mfp_batch(
&mut self,
Expand Down
Loading