@@ -199,9 +199,13 @@ impl<'conn> Transaction<'conn> {
199
199
debug_assert ! ( self . depth == conn. trans_depth) ;
200
200
conn. trans_depth -= 1 ;
201
201
match ( self . commit . get ( ) , & self . savepoint_name ) {
202
- ( false , & Some ( ref savepoint_name) ) => conn. quick_query ( & format ! ( "ROLLBACK TO {}" , savepoint_name) ) ,
202
+ ( false , & Some ( ref savepoint_name) ) => {
203
+ conn. quick_query ( & format ! ( "ROLLBACK TO {}" , savepoint_name) )
204
+ }
203
205
( false , & None ) => conn. quick_query ( "ROLLBACK" ) ,
204
- ( true , & Some ( ref savepoint_name) ) => conn. quick_query ( & format ! ( "RELEASE {}" , savepoint_name) ) ,
206
+ ( true , & Some ( ref savepoint_name) ) => {
207
+ conn. quick_query ( & format ! ( "RELEASE {}" , savepoint_name) )
208
+ }
205
209
( true , & None ) => conn. quick_query ( "COMMIT" ) ,
206
210
} . map ( |_| ( ) )
207
211
}
@@ -234,17 +238,18 @@ impl<'conn> Transaction<'conn> {
234
238
self . conn . batch_execute ( query)
235
239
}
236
240
237
- /// Like `Connection::transaction`, but creates a nested transaction.
241
+ /// Like `Connection::transaction`, but creates a nested transaction via
242
+ /// a savepoint.
238
243
///
239
244
/// # Panics
240
245
///
241
246
/// Panics if there is an active nested transaction.
242
247
pub fn transaction < ' a > ( & ' a self ) -> Result < Transaction < ' a > > {
243
248
self . savepoint ( "sp" )
244
249
}
245
-
246
- /// Like `Connection::transaction`, but creates a nested transaction
247
- /// with the provided name.
250
+
251
+ /// Like `Connection::transaction`, but creates a nested transaction via
252
+ /// a savepoint with the specified name.
248
253
///
249
254
/// # Panics
250
255
///
0 commit comments