@@ -110,7 +110,6 @@ impl FunctionSig {
110110 } ;
111111
112112 let args: Vec < Arc < Type > > = ( 0 ..arg_count)
113- . into_iter ( )
114113 . map ( |_| Arc :: new ( Type :: any_native ( ) ) )
115114 . collect ( ) ;
116115
@@ -134,7 +133,7 @@ impl InstantiatedSig {
134133
135134 match & function. args {
136135 FunctionArguments :: None => {
137- if self . args . len ( ) == 0 {
136+ if self . args . is_empty ( ) {
138137 Ok ( ( ) )
139138 } else {
140139 Err ( TypeError :: Conflict ( format ! (
@@ -197,38 +196,39 @@ impl From<&str> for CompoundIdent {
197196impl From < & Vec < Ident > > for CompoundIdent {
198197 fn from ( value : & Vec < Ident > ) -> Self {
199198 let mut idents = Vec1 :: < SqlIdent < Ident > > :: new ( SqlIdent ( value[ 0 ] . clone ( ) ) ) ;
200- idents. extend ( value[ 1 ..] . into_iter ( ) . cloned ( ) . map ( SqlIdent ) ) ;
199+ idents. extend ( value[ 1 ..] . iter ( ) . cloned ( ) . map ( SqlIdent ) ) ;
201200 CompoundIdent ( idents)
202201 }
203202}
204203
205204/// SQL functions that are handled with special case type checking rules.
206- static SQL_FUNCTION_SIGNATURES : LazyLock < HashMap < CompoundIdent , Vec < FunctionSig > > > = LazyLock :: new ( || {
207- // Notation: a single uppercase letter denotes an unknown type. Matching letters in a signature will be assigned
208- // *the same type variable* and thus must resolve to the same type. (🙏 Haskell)
209- //
210- // Eventually we should type check EQL types against their configured indexes instead of leaving that to the EQL
211- // extension in the database. I can imagine supporting type bounds in signatures here, such as: `T: Eq`
212- let sql_fns = vec ! [
213- sql_fn!( count( T ) -> NATIVE ) ,
214- sql_fn!( min( T ) -> T ) ,
215- sql_fn!( max( T ) -> T ) ,
216- sql_fn!( jsonb_path_query( T , T ) -> T ) ,
217- sql_fn!( jsonb_path_query_first( T , T ) -> T ) ,
218- sql_fn!( jsonb_path_exists( T , T ) -> T ) ,
219- ] ;
220-
221- let mut sql_fns_by_name: HashMap < CompoundIdent , Vec < FunctionSig > > = HashMap :: new ( ) ;
222-
223- for ( key, chunk) in & sql_fns. into_iter ( ) . chunk_by ( |sql_fn| sql_fn. 0 . clone ( ) ) {
224- sql_fns_by_name. insert (
225- key. clone ( ) ,
226- chunk. into_iter ( ) . map ( |sql_fn| sql_fn. 1 ) . collect ( ) ,
227- ) ;
228- }
205+ static SQL_FUNCTION_SIGNATURES : LazyLock < HashMap < CompoundIdent , Vec < FunctionSig > > > =
206+ LazyLock :: new ( || {
207+ // Notation: a single uppercase letter denotes an unknown type. Matching letters in a signature will be assigned
208+ // *the same type variable* and thus must resolve to the same type. (🙏 Haskell)
209+ //
210+ // Eventually we should type check EQL types against their configured indexes instead of leaving that to the EQL
211+ // extension in the database. I can imagine supporting type bounds in signatures here, such as: `T: Eq`
212+ let sql_fns = vec ! [
213+ sql_fn!( count( T ) -> NATIVE ) ,
214+ sql_fn!( min( T ) -> T ) ,
215+ sql_fn!( max( T ) -> T ) ,
216+ sql_fn!( jsonb_path_query( T , T ) -> T ) ,
217+ sql_fn!( jsonb_path_query_first( T , T ) -> T ) ,
218+ sql_fn!( jsonb_path_exists( T , T ) -> T ) ,
219+ ] ;
220+
221+ let mut sql_fns_by_name: HashMap < CompoundIdent , Vec < FunctionSig > > = HashMap :: new ( ) ;
222+
223+ for ( key, chunk) in & sql_fns. into_iter ( ) . chunk_by ( |sql_fn| sql_fn. 0 . clone ( ) ) {
224+ sql_fns_by_name. insert (
225+ key. clone ( ) ,
226+ chunk. into_iter ( ) . map ( |sql_fn| sql_fn. 1 ) . collect ( ) ,
227+ ) ;
228+ }
229229
230- sql_fns_by_name
231- } ) ;
230+ sql_fns_by_name
231+ } ) ;
232232
233233pub ( crate ) fn get_type_signature_for_special_cased_sql_function (
234234 fn_name : & CompoundIdent ,
0 commit comments