chbrown/macos-pasteboard

Deprecation warning when building: “'init(bytes:)' is deprecated”

roryokane opened this issue · 1 comments

When I ran make install, I saw a deprecation warning in part of the output:

xcrun -sdk macosx swiftc pbv.swift -O -o pbv
pbv.swift:5:15: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
let newline = Data(bytes: [0x0A] as [UInt8])
              ^

The warning refers to this line:

let newline = Data(bytes: [0x0A] as [UInt8])

My computer has Swift version 5.0.1 installed, according to swift --version.

pbv still works despite the warning.

Ha, yeah, and the fix has been sitting in my unstaged changes for a while. I didn't realize other people used this. Cool.