Skip to content

Commit e93e509

Browse files
committed
Fix sanity
1 parent 36a34f6 commit e93e509

File tree

21 files changed

+48
-34
lines changed

21 files changed

+48
-34
lines changed

Examples/CloudFunctions/Sources/APIGateway/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28+
import NIO
2829
import TencentSCFEvents
2930
import TencentSCFRuntime
30-
import NIO
3131

3232
// MARK: - Run Lambda
3333

Examples/CloudFunctions/Sources/Benchmark/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntimeCore
2928
import NIO
29+
import TencentSCFRuntimeCore
3030

3131
// If you would like to benchmark Swift's Lambda Runtime,
3232
// use this example which is more performant.

Examples/CloudFunctions/Sources/CurrencyExchange/main.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntime
2928
import Dispatch
3029
import Foundation
30+
import TencentSCFRuntime
3131
#if canImport(FoundationNetworking) && canImport(FoundationXML)
3232
import FoundationNetworking
3333
import FoundationXML
@@ -117,7 +117,8 @@ struct ExchangeRatesCalculator {
117117
monthIndex: Array<Date>.Index,
118118
currencies: [String],
119119
state: [Date: ExchangeRates],
120-
callback: @escaping ((Result<[Date: ExchangeRates], Swift.Error>) -> Void)) {
120+
callback: @escaping ((Result<[Date: ExchangeRates], Swift.Error>) -> Void))
121+
{
121122
if monthIndex == months.count {
122123
return callback(.success(state))
123124
}
@@ -158,7 +159,8 @@ struct ExchangeRatesCalculator {
158159
dateFormatter.dateFormat = "dd/MMM/yy"
159160
let interval: DateInterval?
160161
if let period = try document.nodes(forXPath: "/exchangeRateMonthList/@Period").first?.stringValue,
161-
period.count == 26 {
162+
period.count == 26
163+
{
162164
// "01/Sep/2018 to 30/Sep/2018"
163165
let startString = period[period.startIndex ..< period.index(period.startIndex, offsetBy: 11)]
164166
let to = period[startString.endIndex ..< period.index(startString.endIndex, offsetBy: 4)]
@@ -167,7 +169,8 @@ struct ExchangeRatesCalculator {
167169
let startDay = calendar.dateInterval(of: .day, for: startDate),
168170
to == " to ",
169171
let endDate = dateFormatter.date(from: String(endString)),
170-
let endDay = calendar.dateInterval(of: .day, for: endDate) {
172+
let endDay = calendar.dateInterval(of: .day, for: endDate)
173+
{
171174
interval = DateInterval(start: startDay.start, end: endDay.end)
172175
} else {
173176
interval = nil
@@ -180,7 +183,8 @@ struct ExchangeRatesCalculator {
180183
let xpathCurrency = $0.replacingOccurrences(of: "'", with: "&apos;")
181184
if let rateString = try document.nodes(forXPath: "/exchangeRateMonthList/exchangeRate/currencyCode[text()='\(xpathCurrency)']/../rateNew/text()").first?.stringValue,
182185
// We must parse the decimal data using the UK locale, not the system one.
183-
let rate = Decimal(string: rateString, locale: self.locale) {
186+
let rate = Decimal(string: rateString, locale: self.locale)
187+
{
184188
return ($0, rate)
185189
} else {
186190
return ($0, nil)

Examples/LocalDebugging/MyCloudFunction/Sources/MyCloudFunction/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntime
2928
import Shared
29+
import TencentSCFRuntime
3030

3131
// set LOCAL_SCF_SERVER_ENABLED env variable to "true" to start
3232
// a local server simulator which will allow local debugging

Sources/CodableSample/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntime
2928
import NIO
29+
import TencentSCFRuntime
3030

3131
struct Request: Codable {
3232
let body: String

Sources/StringSample/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntimeCore
2928
import NIO
29+
import TencentSCFRuntimeCore
3030

3131
// in this example we are receiving and responding with strings
3232
struct Handler: EventLoopLambdaHandler {

Sources/TencentSCFEvents/DynamoDB.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ extension DynamoDB {
354354
}
355355

356356
@usableFromInline func container<Key>(keyedBy type: Key.Type) throws ->
357-
KeyedDecodingContainer<Key> where Key: CodingKey {
357+
KeyedDecodingContainer<Key> where Key: CodingKey
358+
{
358359
guard case .map(let dictionary) = self.value else {
359360
throw DecodingError.typeMismatch([String: AttributeValue].self, DecodingError.Context(
360361
codingPath: self.codingPath,
@@ -523,7 +524,8 @@ extension DynamoDB {
523524
}
524525

525526
func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type, forKey key: K) throws
526-
-> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey {
527+
-> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey
528+
{
527529
try self.decoderForKey(key).container(keyedBy: type)
528530
}
529531

@@ -862,7 +864,8 @@ extension DynamoDB {
862864
}
863865

864866
mutating func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type) throws
865-
-> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey {
867+
-> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey
868+
{
866869
try self.impl.container(keyedBy: type)
867870
}
868871

Sources/TencentSCFEvents/Utils/Base64.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ extension Base64 {
5050

5151
@inlinable
5252
static func decode<Buffer: Collection>(encoded: Buffer, options: DecodingOptions = [])
53-
throws -> [UInt8] where Buffer.Element == UInt8 {
53+
throws -> [UInt8] where Buffer.Element == UInt8
54+
{
5455
let alphabet = options.contains(.base64UrlAlphabet)
5556
? Base64.decodeBase64Url
5657
: Base64.decodeBase64

Sources/TencentSCFRuntime/Context+Foundation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
import TencentSCFRuntimeCore
2928
import struct Foundation.Date
29+
import TencentSCFRuntimeCore
3030

3131
extension Lambda.Context {
3232
var deadlineDate: Date {

Sources/TencentSCFRuntime/Lambda+Codable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
//
2626
//===------------------------------------------------------------------------------------===//
2727

28-
@_exported import TencentSCFRuntimeCore
2928
import class Foundation.JSONDecoder
3029
import class Foundation.JSONEncoder
3130
import NIO
3231
import NIOFoundationCompat
32+
@_exported import TencentSCFRuntimeCore
3333

3434
/// Extension to the `Lambda` companion to enable execution of Lambdas that take and return `Codable` events.
3535
extension Lambda {

0 commit comments

Comments
 (0)