diff --git a/crates/proof-of-sql/src/base/arrow/owned_and_arrow_conversions.rs b/crates/proof-of-sql/src/base/arrow/owned_and_arrow_conversions.rs index ca7011fa8..3b92bf911 100644 --- a/crates/proof-of-sql/src/base/arrow/owned_and_arrow_conversions.rs +++ b/crates/proof-of-sql/src/base/arrow/owned_and_arrow_conversions.rs @@ -303,7 +303,7 @@ impl TryFrom for OwnedTable { .zip(value.columns()) .map(|(field, array_ref)| { let owned_column = OwnedColumn::try_from(array_ref)?; - let identifier = Ident::new(field.name()); //This may always succeed. + let identifier = Ident::new(field.name()); Ok((identifier, owned_column)) }) .collect(); diff --git a/crates/proof-of-sql/src/base/database/owned_table_utility.rs b/crates/proof-of-sql/src/base/database/owned_table_utility.rs index 6126c61ff..40f5ebd92 100644 --- a/crates/proof-of-sql/src/base/database/owned_table_utility.rs +++ b/crates/proof-of-sql/src/base/database/owned_table_utility.rs @@ -16,7 +16,6 @@ use super::{OwnedColumn, OwnedTable}; use crate::base::scalar::Scalar; use alloc::string::String; -use core::ops::Deref; use proof_of_sql_parser::posql_time::{PoSQLTimeUnit, PoSQLTimeZone}; use sqlparser::ast::Ident; @@ -58,11 +57,11 @@ pub fn owned_table( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn tinyint( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::TinyInt(data.into_iter().map(Into::into).collect()), ) } @@ -79,11 +78,11 @@ pub fn tinyint( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn smallint( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::SmallInt(data.into_iter().map(Into::into).collect()), ) } @@ -100,11 +99,11 @@ pub fn smallint( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn int( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::Int(data.into_iter().map(Into::into).collect()), ) } @@ -120,11 +119,11 @@ pub fn int( /// ``` #[allow(clippy::missing_panics_doc)] pub fn bigint( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::BigInt(data.into_iter().map(Into::into).collect()), ) } @@ -142,11 +141,11 @@ pub fn bigint( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn boolean( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::Boolean(data.into_iter().map(Into::into).collect()), ) } @@ -164,11 +163,11 @@ pub fn boolean( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn int128( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::Int128(data.into_iter().map(Into::into).collect()), ) } @@ -186,11 +185,11 @@ pub fn int128( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn scalar( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::Scalar(data.into_iter().map(Into::into).collect()), ) } @@ -208,11 +207,11 @@ pub fn scalar( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn varchar( - name: impl Deref, + name: impl Into, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::VarChar(data.into_iter().map(Into::into).collect()), ) } @@ -231,13 +230,13 @@ pub fn varchar( /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. /// - Panics if creating the `Precision` from the specified precision value fails. pub fn decimal75( - name: impl Deref, + name: impl Into, precision: u8, scale: i8, data: impl IntoIterator>, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::Decimal75( crate::base::math::decimal::Precision::new(precision).unwrap(), scale, @@ -271,13 +270,13 @@ pub fn decimal75( /// # Panics /// - Panics if `name.parse()` fails to convert the name into an `Identifier`. pub fn timestamptz( - name: impl Deref, + name: impl Into, time_unit: PoSQLTimeUnit, timezone: PoSQLTimeZone, data: impl IntoIterator, ) -> (Ident, OwnedColumn) { ( - name.deref().into(), + name.into(), OwnedColumn::TimestampTZ(time_unit, timezone, data.into_iter().collect()), ) }