mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
Fix Nightly Build to work with new Swift versions (#2288)
Swift 5.8 has recently changed the name of the function assign to now be called update. Now, they call update like seen in this proposal: https://github.com/apple/swift-evolution/blob/main/proposals/0370-pointer-family-initialization-improvements.md Co-authored-by: Carolina Cassedy <ccassedy@apple.com> Co-authored-by: Cory Benfield <lukasa@apple.com> Co-authored-by: David Nadoba <d_nadoba@apple.com>
This commit is contained in:
1 file changed
+9
-1
@@ -339,7 +339,7 @@ class SocketAddressTest: XCTestCase {
|
||||
pathBytes.withUnsafeBufferPointer { srcPtr in
|
||||
withUnsafeMutablePointer(to: &addr.sun_path) { dstPtr in
|
||||
dstPtr.withMemoryRebound(to: UInt8.self, capacity: srcPtr.count) { dstPtr in
|
||||
dstPtr.assign(from: srcPtr.baseAddress!, count: srcPtr.count)
|
||||
dstPtr.update(from: srcPtr.baseAddress!, count: srcPtr.count)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -571,3 +571,11 @@ class SocketAddressTest: XCTestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(<5.8)
|
||||
extension UnsafeMutablePointer {
|
||||
func update(from source: UnsafePointer<Pointee>, count: Int) {
|
||||
self.assign(from: source, count: count)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user