Replace ByteBufferTest use of deprecated "withUnsafeBytes" with new API

Motivation:

Remove the only warning in the project.

Modifications:

Use new withUnsafeBytes API.

Result:

The project will have no warnings.
This commit is contained in:
Jovan Milenkovic committed 2019-01-22 00:43:46 +01:00
1 parent 313ddabb48
commit b41e50403b
1 file changed
+1 -3
+1 -3
View File
@@ -763,9 +763,7 @@ class ByteBufferTest: XCTestCase {
buf.write(string: str)
var written1: Int = -1
var written2: Int = -1
let hwDataCount = hwData.count
hwData.withUnsafeBytes { (ptr: UnsafePointer<Int8>) -> Void in
let ptr = UnsafeRawBufferPointer(start: ptr, count: hwDataCount)
hwData.withUnsafeBytes { ptr in
/* ... write a second time and ...*/
written1 = buf.set(bytes: ptr, at: buf.writerIndex)
buf.moveWriterIndex(forwardBy: written1)