Closed jpsim closed 2 years ago
I made a few updates after realizing that the initial code wasn't safe. Should be good to go now.
CI didn't run on the latest commits of this PR.
Tests failed on main
, but they pass for me locally when running swift test
with Xcode 14b4.
Sorry folks had to revert this 😞 as it was causing some reference generation instability (tests caught this when run repeatedly)
I understand. I don't see how what I wrote is unsafe, but it clearly is.
Short description 📝
There's a deprecation warning when building with Xcode 14 targeting macOS 13:
This is because
String.init(bytesNoCopy:...)
was deprecated in macOS 13: https://developer.apple.com/documentation/swift/string/init(bytesnocopy:length:encoding:freewhendone:)Further discussion here: https://forums.swift.org/t/does-string-bytesnocopy-copy-bytes/51643/11
Solution 📦
Use
String.init(cString:)
instead.Implementation 👩💻👨💻
String.init(cString:)
instead ofString.init(bytesNoCopy:...)