@@ -25,7 +25,7 @@ use futures_util::{pin_mut, TryStreamExt};
2525use std:: { borrow:: Cow , sync:: Arc } ;
2626
2727impl MySqlConnection {
28- async fn get_or_prepare < ' c > (
28+ async fn get_or_prepare (
2929 & mut self ,
3030 sql : & str ,
3131 persistent : bool ,
@@ -155,7 +155,7 @@ impl MySqlConnection {
155155 // otherwise, this first packet is the start of the result-set metadata,
156156 * self . stream. waiting. front_mut( ) . unwrap( ) = Waiting :: Row ;
157157
158- let num_columns = packet. get_uint_lenenc( ) as usize ; // column count
158+ let num_columns = usize :: try_from ( packet. get_uint_lenenc( ) ) . expect ( "column count should fit in usize" ) ; // column count
159159
160160 if needs_metadata {
161161 column_names = Arc :: new( recv_result_metadata( & mut self . stream, num_columns, Arc :: make_mut( & mut columns) ) . await ?) ;
@@ -289,7 +289,7 @@ impl<'c> Executor<'c> for &'c mut MySqlConnection {
289289
290290 let ( _, metadata) = self . get_or_prepare ( sql, false ) . await ?;
291291
292- let columns = ( & * metadata. columns ) . clone ( ) ;
292+ let columns = ( * metadata. columns ) . clone ( ) ;
293293
294294 let nullable = columns
295295 . iter ( )
@@ -335,7 +335,7 @@ fn recv_next_result_column(def: &ColumnDefinition, ordinal: usize) -> Result<MyS
335335 ( name, _) => UStr :: new ( name) ,
336336 } ;
337337
338- let type_info = MySqlTypeInfo :: from_column ( & def) ;
338+ let type_info = MySqlTypeInfo :: from_column ( def) ;
339339
340340 Ok ( MySqlColumn {
341341 name,
0 commit comments