mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
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:
1 parent
313ddabb48
commit
b41e50403b
1 file changed
+1
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user