@@ -100,7 +100,7 @@ extension ExpressionType where UnderlyingType == Double {
100
100
///
101
101
/// - Returns: A copy of the expression wrapped with the `round` function.
102
102
public func round( _ precision: Int ? = nil ) -> Expression < UnderlyingType > {
103
- guard let precision = precision else {
103
+ guard let precision else {
104
104
return Function . round. wrap ( [ self ] )
105
105
}
106
106
return Function . round. wrap ( [ self , Int ( precision) ] )
@@ -120,7 +120,7 @@ extension ExpressionType where UnderlyingType == Double? {
120
120
///
121
121
/// - Returns: A copy of the expression wrapped with the `round` function.
122
122
public func round( _ precision: Int ? = nil ) -> Expression < UnderlyingType > {
123
- guard let precision = precision else {
123
+ guard let precision else {
124
124
return Function . round. wrap ( self )
125
125
}
126
126
return Function . round. wrap ( [ self , Int ( precision) ] )
@@ -250,7 +250,7 @@ extension ExpressionType where UnderlyingType == String {
250
250
/// - Returns: A copy of the expression appended with a `LIKE` query against
251
251
/// the given pattern.
252
252
public func like( _ pattern: String , escape character: Character ? = nil ) -> Expression < Bool > {
253
- guard let character = character else {
253
+ guard let character else {
254
254
return " LIKE " . infix ( self , pattern)
255
255
}
256
256
return Expression ( " ( \( template) LIKE ? ESCAPE ?) " , bindings + [ pattern, String ( character) ] )
@@ -274,7 +274,7 @@ extension ExpressionType where UnderlyingType == String {
274
274
/// - Returns: A copy of the expression appended with a `LIKE` query against
275
275
/// the given pattern.
276
276
public func like( _ pattern: Expression < String > , escape character: Character ? = nil ) -> Expression < Bool > {
277
- guard let character = character else {
277
+ guard let character else {
278
278
return Function . like. infix ( self , pattern)
279
279
}
280
280
let like : Expression < Bool > = Function . like. infix ( self , pattern, wrap: false )
@@ -349,7 +349,7 @@ extension ExpressionType where UnderlyingType == String {
349
349
///
350
350
/// - Returns: A copy of the expression wrapped with the `ltrim` function.
351
351
public func ltrim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
352
- guard let characters = characters else {
352
+ guard let characters else {
353
353
return Function . ltrim. wrap ( self )
354
354
}
355
355
return Function . ltrim. wrap ( [ self , String ( characters) ] )
@@ -367,7 +367,7 @@ extension ExpressionType where UnderlyingType == String {
367
367
///
368
368
/// - Returns: A copy of the expression wrapped with the `rtrim` function.
369
369
public func rtrim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
370
- guard let characters = characters else {
370
+ guard let characters else {
371
371
return Function . rtrim. wrap ( self )
372
372
}
373
373
return Function . rtrim. wrap ( [ self , String ( characters) ] )
@@ -385,7 +385,7 @@ extension ExpressionType where UnderlyingType == String {
385
385
///
386
386
/// - Returns: A copy of the expression wrapped with the `trim` function.
387
387
public func trim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
388
- guard let characters = characters else {
388
+ guard let characters else {
389
389
return Function . trim. wrap ( [ self ] )
390
390
}
391
391
return Function . trim. wrap ( [ self , String ( characters) ] )
@@ -409,7 +409,7 @@ extension ExpressionType where UnderlyingType == String {
409
409
}
410
410
411
411
public func substring( _ location: Int , length: Int ? = nil ) -> Expression < UnderlyingType > {
412
- guard let length = length else {
412
+ guard let length else {
413
413
return Function . substr. wrap ( [ self , location] )
414
414
}
415
415
return Function . substr. wrap ( [ self , location, length] )
@@ -475,7 +475,7 @@ extension ExpressionType where UnderlyingType == String? {
475
475
/// - Returns: A copy of the expression appended with a `LIKE` query against
476
476
/// the given pattern.
477
477
public func like( _ pattern: String , escape character: Character ? = nil ) -> Expression < Bool ? > {
478
- guard let character = character else {
478
+ guard let character else {
479
479
return Function . like. infix ( self , pattern)
480
480
}
481
481
return Expression ( " ( \( template) LIKE ? ESCAPE ?) " , bindings + [ pattern, String ( character) ] )
@@ -499,7 +499,7 @@ extension ExpressionType where UnderlyingType == String? {
499
499
/// - Returns: A copy of the expression appended with a `LIKE` query against
500
500
/// the given pattern.
501
501
public func like( _ pattern: Expression < String > , escape character: Character ? = nil ) -> Expression < Bool ? > {
502
- guard let character = character else {
502
+ guard let character else {
503
503
return Function . like. infix ( self , pattern)
504
504
}
505
505
let like : Expression < Bool > = Function . like. infix ( self , pattern, wrap: false )
@@ -574,7 +574,7 @@ extension ExpressionType where UnderlyingType == String? {
574
574
///
575
575
/// - Returns: A copy of the expression wrapped with the `ltrim` function.
576
576
public func ltrim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
577
- guard let characters = characters else {
577
+ guard let characters else {
578
578
return Function . ltrim. wrap ( self )
579
579
}
580
580
return Function . ltrim. wrap ( [ self , String ( characters) ] )
@@ -592,7 +592,7 @@ extension ExpressionType where UnderlyingType == String? {
592
592
///
593
593
/// - Returns: A copy of the expression wrapped with the `rtrim` function.
594
594
public func rtrim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
595
- guard let characters = characters else {
595
+ guard let characters else {
596
596
return Function . rtrim. wrap ( self )
597
597
}
598
598
return Function . rtrim. wrap ( [ self , String ( characters) ] )
@@ -610,7 +610,7 @@ extension ExpressionType where UnderlyingType == String? {
610
610
///
611
611
/// - Returns: A copy of the expression wrapped with the `trim` function.
612
612
public func trim( _ characters: Set < Character > ? = nil ) -> Expression < UnderlyingType > {
613
- guard let characters = characters else {
613
+ guard let characters else {
614
614
return Function . trim. wrap ( self )
615
615
}
616
616
return Function . trim. wrap ( [ self , String ( characters) ] )
@@ -649,7 +649,7 @@ extension ExpressionType where UnderlyingType == String? {
649
649
///
650
650
/// - Returns: A copy of the expression wrapped with the `substr` function.
651
651
public func substring( _ location: Int , length: Int ? = nil ) -> Expression < UnderlyingType > {
652
- guard let length = length else {
652
+ guard let length else {
653
653
return Function . substr. wrap ( [ self , location] )
654
654
}
655
655
return Function . substr. wrap ( [ self , location, length] )
@@ -726,7 +726,7 @@ extension String {
726
726
/// - Returns: A copy of the expression appended with a `LIKE` query against
727
727
/// the given pattern.
728
728
public func like( _ pattern: Expression < String > , escape character: Character ? = nil ) -> Expression < Bool > {
729
- guard let character = character else {
729
+ guard let character else {
730
730
return Function . like. infix ( self , pattern)
731
731
}
732
732
let like : Expression < Bool > = Function . like. infix ( self , pattern, wrap: false )
0 commit comments