File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,34 +166,13 @@ impl StdlibRegistry {
166166 . map ( |i| stmt. column_name ( i) . unwrap_or ( "?" ) . to_string ( ) )
167167 . collect ( ) ;
168168
169- let params_converted: Vec < rusqlite:: types:: Value > = params_list
170- . iter ( )
171- . map ( |p| match p {
172- RuntimeValue :: Null => rusqlite:: types:: Value :: Null ,
173- RuntimeValue :: Bool ( b) => {
174- rusqlite:: types:: Value :: Integer ( if * b { 1 } else { 0 } )
175- }
176- RuntimeValue :: Int ( i) => rusqlite:: types:: Value :: Integer ( * i) ,
177- RuntimeValue :: Float ( f) => rusqlite:: types:: Value :: Real ( * f) ,
178- RuntimeValue :: Str ( s) => rusqlite:: types:: Value :: Text ( s. clone ( ) ) ,
179- _ => rusqlite:: types:: Value :: Null ,
180- } )
181- . collect ( ) ;
182-
183- let params_refs: Vec < & dyn rusqlite:: types:: ToSql > = params_converted
184- . iter ( )
185- . map ( |p| p as & dyn rusqlite:: types:: ToSql )
186- . collect ( ) ;
187169
188- let mut rows = Vec :: new ( ) ;
189- let row_iter = stmt
190- <<<<<
191- let mut map = IndexMap :: new ( ) ;
192170 for i in 0 ..col_count {
193- let name = col_names[ i ] . clone ( ) ;
194171 let val: String =
195172 row. get :: < _ , String > ( i) . unwrap_or_default ( ) ;
196- map. insert ( name , RuntimeValue :: Str ( val ) ) ;
173+ if let Some ( ( _, v) ) = map. get_index_mut ( i) {
174+ * v = RuntimeValue :: Str ( val) ;
175+ }
197176 }
198177 Ok ( map)
199178 } )
You can’t perform that action at this time.
0 commit comments