@@ -222,7 +222,7 @@ impl Database for LibsqlConn {
222222 }
223223
224224 async fn get_profiles ( & self ) -> Result < Vec < Profile > , DbError > {
225- let mut stmt = self
225+ let stmt = self
226226 . prepare (
227227 "
228228 SELECT
@@ -247,7 +247,7 @@ impl Database for LibsqlConn {
247247 }
248248
249249 async fn get_profiles_for_user ( & self , user : & User ) -> Result < Vec < Profile > , DbError > {
250- let mut stmt = self
250+ let stmt = self
251251 . prepare (
252252 "
253253 SELECT DISTINCT
@@ -336,7 +336,7 @@ impl Database for LibsqlConn {
336336 params ! [
337337 profile. name. as_str( ) ,
338338 match & profile. description {
339- Some ( description) => Value :: Text ( description. to_string ( ) ) ,
339+ Some ( description) => Value :: Text ( description. clone ( ) ) ,
340340 None => Value :: Null ,
341341 } ,
342342 elevation_method,
@@ -361,7 +361,7 @@ impl Database for LibsqlConn {
361361 profile. id,
362362 profile. name. as_str( ) ,
363363 match & profile. description {
364- Some ( description) => Value :: Text ( description. to_string ( ) ) ,
364+ Some ( description) => Value :: Text ( description. clone ( ) ) ,
365365 None => Value :: Null ,
366366 } ,
367367 elevation_method,
@@ -592,7 +592,7 @@ impl Database for LibsqlConn {
592592 }
593593
594594 async fn get_users ( & self ) -> Result < Vec < User > , DbError > {
595- let mut stmt = self
595+ let stmt = self
596596 . prepare ( "SELECT id, account_name, domain_name, account_sid, domain_sid FROM user" )
597597 . await ?;
598598
@@ -626,7 +626,7 @@ impl Database for LibsqlConn {
626626 }
627627
628628 async fn get_jit_elevation_log ( & self , id : i64 ) -> Result < Option < JitElevationLogRow > , DbError > {
629- let mut stmt = self
629+ let stmt = self
630630 . prepare (
631631 "SELECT
632632 j.id,
@@ -765,7 +765,7 @@ impl Database for LibsqlConn {
765765 params. push ( limit. into ( ) ) ;
766766 params. push ( offset. into ( ) ) ;
767767
768- let mut stmt = self . prepare ( & select_sql) . await ?;
768+ let stmt = self . prepare ( & select_sql) . await ?;
769769 let mut rows = stmt. query ( libsql:: params_from_iter ( params) ) . await ?;
770770
771771 let mut results = Vec :: new ( ) ;
@@ -807,6 +807,8 @@ fn parse_micros(micros: i64) -> Result<DateTime<Utc>, ParseTimestampError> {
807807
808808#[ cfg( test) ]
809809mod tests {
810+ #![ allow( clippy:: unwrap_used, reason = "test code can panic on errors" ) ]
811+
810812 use chrono:: { TimeZone , Utc } ;
811813
812814 use super :: parse_micros;
0 commit comments