3131 ) -> PSQLPyResult < ( ) > {
3232 let start_qs = self . build_start_qs ( isolation_level, read_variant, deferrable) ;
3333 self . batch_execute ( start_qs. as_str ( ) ) . await . map_err ( |err| {
34- RustPSQLDriverError :: TransactionBeginError (
35- format ! ( "Cannot start transaction due to - {err}" ) . into ( ) ,
36- )
34+ RustPSQLDriverError :: TransactionBeginError ( format ! (
35+ "Cannot start transaction due to - {err}"
36+ ) )
3737 } ) ?;
3838
3939 Ok ( ( ) )
@@ -65,7 +65,7 @@ impl Connection for SingleConnection {
6565 if !prepared {
6666 self . drop_prepared ( & prepared_stmt) . await ?;
6767 }
68- return Ok ( prepared_stmt) ;
68+ Ok ( prepared_stmt)
6969 }
7070
7171 async fn drop_prepared ( & self , stmt : & Statement ) -> PSQLPyResult < ( ) > {
@@ -116,28 +116,27 @@ impl StartTransaction for SingleConnection {
116116 read_variant : Option < ReadVariant > ,
117117 deferrable : Option < bool > ,
118118 ) -> PSQLPyResult < ( ) > {
119- let res = self
120- . _start_transaction ( isolation_level, read_variant, deferrable)
119+ self . _start_transaction ( isolation_level, read_variant, deferrable)
121120 . await ?;
122121 self . in_transaction = true ;
123122
124- Ok ( res )
123+ Ok ( ( ) )
125124 }
126125}
127126
128127impl CloseTransaction for SingleConnection {
129128 async fn commit ( & mut self ) -> PSQLPyResult < ( ) > {
130- let res = self . _commit ( ) . await ?;
129+ self . _commit ( ) . await ?;
131130 self . in_transaction = false ;
132131
133- Ok ( res )
132+ Ok ( ( ) )
134133 }
135134
136135 async fn rollback ( & mut self ) -> PSQLPyResult < ( ) > {
137- let res = self . _rollback ( ) . await ?;
136+ self . _rollback ( ) . await ?;
138137 self . in_transaction = false ;
139138
140- Ok ( res )
139+ Ok ( ( ) )
141140 }
142141}
143142
@@ -149,7 +148,7 @@ impl Connection for PoolConnection {
149148
150149 let prepared = self . connection . prepare ( query) . await ?;
151150 self . drop_prepared ( & prepared) . await ?;
152- return Ok ( prepared) ;
151+ Ok ( prepared)
153152 }
154153
155154 async fn drop_prepared ( & self , stmt : & Statement ) -> PSQLPyResult < ( ) > {
@@ -208,17 +207,17 @@ impl StartTransaction for PoolConnection {
208207
209208impl CloseTransaction for PoolConnection {
210209 async fn commit ( & mut self ) -> PSQLPyResult < ( ) > {
211- let res = self . _commit ( ) . await ?;
210+ self . _commit ( ) . await ?;
212211 self . in_transaction = false ;
213212
214- Ok ( res )
213+ Ok ( ( ) )
215214 }
216215
217216 async fn rollback ( & mut self ) -> PSQLPyResult < ( ) > {
218- let res = self . _rollback ( ) . await ?;
217+ self . _rollback ( ) . await ?;
219218 self . in_transaction = false ;
220219
221- Ok ( res )
220+ Ok ( ( ) )
222221 }
223222}
224223
@@ -407,14 +406,14 @@ impl PSQLPyConnection {
407406
408407 for statement in statements {
409408 let querystring_result = if prepared {
410- let prepared_stmt = & self . prepare ( & statement. raw_query ( ) , true ) . await ;
409+ let prepared_stmt = & self . prepare ( statement. raw_query ( ) , true ) . await ;
411410 if let Err ( error) = prepared_stmt {
412411 return Err ( RustPSQLDriverError :: ConnectionExecuteError ( format ! (
413412 "Cannot prepare statement in execute_many, operation rolled back {error}" ,
414413 ) ) ) ;
415414 }
416415 self . query (
417- & self . prepare ( & statement. raw_query ( ) , true ) . await ?,
416+ & self . prepare ( statement. raw_query ( ) , true ) . await ?,
418417 & statement. params ( ) ,
419418 )
420419 . await
@@ -429,7 +428,7 @@ impl PSQLPyConnection {
429428 }
430429 }
431430
432- return Ok ( ( ) ) ;
431+ Ok ( ( ) )
433432 }
434433
435434 pub async fn fetch_row_raw (
@@ -447,7 +446,7 @@ impl PSQLPyConnection {
447446 let result = if prepared {
448447 self . query_one (
449448 & self
450- . prepare ( & statement. raw_query ( ) , true )
449+ . prepare ( statement. raw_query ( ) , true )
451450 . await
452451 . map_err ( |err| {
453452 RustPSQLDriverError :: ConnectionExecuteError ( format ! (
@@ -464,7 +463,7 @@ impl PSQLPyConnection {
464463 . map_err ( |err| RustPSQLDriverError :: ConnectionExecuteError ( format ! ( "{err}" ) ) ) ?
465464 } ;
466465
467- return Ok ( result) ;
466+ Ok ( result)
468467 }
469468
470469 pub async fn fetch_row (
@@ -477,7 +476,7 @@ impl PSQLPyConnection {
477476 . fetch_row_raw ( querystring, parameters, prepared)
478477 . await ?;
479478
480- return Ok ( PSQLDriverSinglePyQueryResult :: new ( result) ) ;
479+ Ok ( PSQLDriverSinglePyQueryResult :: new ( result) )
481480 }
482481
483482 pub async fn fetch_val (
@@ -490,10 +489,10 @@ impl PSQLPyConnection {
490489 . fetch_row_raw ( querystring, parameters, prepared)
491490 . await ?;
492491
493- return Python :: with_gil ( |gil| match result. columns ( ) . first ( ) {
492+ Python :: with_gil ( |gil| match result. columns ( ) . first ( ) {
494493 Some ( first_column) => postgres_to_py ( gil, & result, first_column, 0 , & None ) ,
495494 None => Ok ( gil. None ( ) ) ,
496- } ) ;
495+ } )
497496 }
498497
499498 pub async fn copy_in < T , U > ( & self , statement : & T ) -> PSQLPyResult < CopyInSink < U > >
0 commit comments