Skip to content

Commit 0bd6063

Browse files
committed
Remove warnings
1 parent bcc802e commit 0bd6063

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Sources/TelegramBotSDK/TelegramBot.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ public class TelegramBot {
196196
let byteCount = requestData.count - 1
197197

198198
DispatchQueue.global().async {
199-
requestData.withUnsafeBytes { (bytes: UnsafePointer<UInt8>)->Void in
200-
self.curlPerformRequest(endpointUrl: endpointUrl, contentType: contentType, resultType: resultType, requestBytes: bytes, byteCount: byteCount, completion: completion)
199+
requestData.withUnsafeBytes { (unsafeRawBufferPointer) -> Void in
200+
let unsafeBufferPointer = unsafeRawBufferPointer.bindMemory(to: UInt8.self).baseAddress!
201+
self.curlPerformRequest(endpointUrl: endpointUrl, contentType: contentType, resultType: resultType, requestBytes: unsafeBufferPointer, byteCount: byteCount, completion: completion)
201202
}
202203
}
203204
}

Tests/TelegramBotSDKTests/BlockingServerTests.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ class BlockingServerTests: XCTestCase {
3737
}
3838
}
3939
}
40-
print("Server stopped due to error: \(bot.lastError)")
40+
if let lastError = bot.lastError {
41+
print("Server stopped due to error: \(lastError)")
42+
}
4143
}
4244

4345
static var allTests : [(String, (BlockingServerTests) -> () throws -> Void)] {

0 commit comments

Comments
 (0)