As @David_Smith said, the withUnsafeBytes() method passing a typed pointer to the closure has been deprecated in favor of a method which passes a raw pointer to the closure, see also
You can also let the compiler infer the closure parameters automatically (and omit the return keyword for single-expression closures/functions):