We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following extension:
extension Array { init?(unsafeData: Data) { guard unsafeData.count % MemoryLayout<Element>.stride == 0 else { return nil } self = unsafeData.withUnsafeBytes { .init($0.bindMemory(to: Element.self)) } } }
Which I use like this:
let bytes = [UInt8](unsafeData: byteData)!
however it's being reported as unused.
The text was updated successfully, but these errors were encountered:
Unfortunately this is a known bug in Swift (swiftlang/swift#56165). You can workaround it by changing the call site to:
let bytes: [UInt8] = Array(unsafeData: byteData)!
Sorry, something went wrong.
No branches or pull requests
I have the following extension:
Which I use like this:
however it's being reported as unused.
The text was updated successfully, but these errors were encountered: