@@ -414,7 +414,7 @@ public final class Connection {
414414 /// times it’s been called for this lock. If it returns `true`, it will
415415 /// try again. If it returns `false`, no further attempts will be made.
416416 public func busyHandler( _ callback: ( ( _ tries: Int ) -> Bool ) ? ) {
417- guard let callback = callback else {
417+ guard let callback else {
418418 sqlite3_busy_handler ( handle, nil , nil )
419419 busyHandler = nil
420420 return
@@ -449,7 +449,7 @@ public final class Connection {
449449 @available ( watchOS, deprecated: 3.0 )
450450 @available ( tvOS, deprecated: 10.0 )
451451 fileprivate func trace_v1( _ callback: ( ( String ) -> Void ) ? ) {
452- guard let callback = callback else {
452+ guard let callback else {
453453 sqlite3_trace ( handle, nil /* xCallback */, nil /* pCtx */)
454454 trace = nil
455455 return
@@ -458,7 +458,7 @@ public final class Connection {
458458 callback ( String ( cString: pointer. assumingMemoryBound ( to: UInt8 . self) ) )
459459 }
460460 sqlite3_trace ( handle, { ( context: UnsafeMutableRawPointer ? , SQL: UnsafePointer < Int8 > ? ) in
461- if let context = context , let SQL = SQL {
461+ if let context, let SQL {
462462 unsafeBitCast ( context, to: Trace . self) ( SQL)
463463 }
464464 } ,
@@ -469,7 +469,7 @@ public final class Connection {
469469
470470 @available ( iOS 10 . 0 , OSX 10 . 12 , tvOS 10 . 0 , watchOS 3 . 0 , * )
471471 fileprivate func trace_v2( _ callback: ( ( String ) -> Void ) ? ) {
472- guard let callback = callback else {
472+ guard let callback else {
473473 // If the X callback is NULL or if the M mask is zero, then tracing is disabled.
474474 sqlite3_trace_v2 ( handle, 0 /* mask */, nil /* xCallback */, nil /* pCtx */)
475475 trace = nil
@@ -485,7 +485,7 @@ public final class Connection {
485485 // callback was invoked. The C argument is a copy of the context pointer.
486486 // The P and X arguments are pointers whose meanings depend on T.
487487 ( _: UInt32 , context: UnsafeMutableRawPointer ? , pointer: UnsafeMutableRawPointer ? , _: UnsafeMutableRawPointer ? ) in
488- if let pointer = pointer ,
488+ if let pointer,
489489 let expandedSQL = sqlite3_expanded_sql ( OpaquePointer ( pointer) ) {
490490 unsafeBitCast ( context, to: Trace . self) ( expandedSQL)
491491 sqlite3_free ( expandedSQL)
@@ -507,7 +507,7 @@ public final class Connection {
507507 /// `.Insert`, `.Update`, or `.Delete`), database name, table name, and
508508 /// rowid.
509509 public func updateHook( _ callback: ( ( _ operation: Operation , _ db: String , _ table: String , _ rowid: Int64 ) -> Void ) ? ) {
510- guard let callback = callback else {
510+ guard let callback else {
511511 sqlite3_update_hook ( handle, nil , nil )
512512 updateHook = nil
513513 return
@@ -535,7 +535,7 @@ public final class Connection {
535535 /// committed. If this callback throws, the transaction will be rolled
536536 /// back.
537537 public func commitHook( _ callback: ( ( ) throws -> Void ) ? ) {
538- guard let callback = callback else {
538+ guard let callback else {
539539 sqlite3_commit_hook ( handle, nil , nil )
540540 commitHook = nil
541541 return
@@ -562,7 +562,7 @@ public final class Connection {
562562 /// - Parameter callback: A callback invoked when a transaction is rolled
563563 /// back.
564564 public func rollbackHook( _ callback: ( ( ) -> Void ) ? ) {
565- guard let callback = callback else {
565+ guard let callback else {
566566 sqlite3_rollback_hook ( handle, nil , nil )
567567 rollbackHook = nil
568568 return
@@ -650,7 +650,7 @@ public final class Connection {
650650 try check ( sqlite3_create_collation_v2 ( handle, collation, SQLITE_UTF8,
651651 unsafeBitCast ( box, to: UnsafeMutableRawPointer . self) , { ( callback: UnsafeMutableRawPointer ? , _,
652652 lhs: UnsafeRawPointer ? , _, rhs: UnsafeRawPointer ? ) in /* xCompare */
653- if let lhs = lhs , let rhs = rhs {
653+ if let lhs, let rhs {
654654 return unsafeBitCast ( callback, to: Collation . self) ( lhs, rhs)
655655 } else {
656656 fatalError ( " sqlite3_create_collation_v2 callback called with NULL pointer " )
0 commit comments