@@ -281,38 +281,6 @@ public struct Data : RandomAccessCollection, MutableCollection, RangeReplaceable
281281 _representation = . empty
282282 }
283283
284- /// Creates a data instance with the specified capacity, and then calls the given
285- /// closure with an output span covering the instance's uninitialized memory.
286- ///
287- /// Inside the closure, initialize elements by appending to the `OutputRawSpan`.
288- /// The `OutputRawSpan` keeps track of the initialized memory, ensuring
289- /// safety. Its `count` at the end of the closure will become the `count` of
290- /// the newly-initialized instance of `Data`.
291- ///
292- /// - Note: While the resulting `Data` may have a capacity larger than the
293- /// requested amount, the `OutputRawSpan` passed to the closure will cover
294- /// exactly the number of bytes requested.
295- ///
296- /// - Parameters:
297- /// - capacity: The number of bytes to allocate space for in the new `Data`.
298- /// - initializer: A closure to initialize the allocated memory.
299- /// - Parameters:
300- /// - span: An `OutputRawSpan` covering uninitialized memory with
301- /// space for the specified number of bytes.
302- @available ( macOS, introduced: 10.14 . 4 , deprecated, renamed: " init(capacity:initializingWith:) " )
303- @available ( iOS, introduced: 12.2 , deprecated, renamed: " init(capacity:initializingWith:) " )
304- @available ( watchOS, introduced: 5.2 , deprecated, renamed: " init(capacity:initializingWith:) " )
305- @available ( tvOS, introduced: 12.2 , deprecated, renamed: " init(capacity:initializingWith:) " )
306- @available ( visionOS, introduced: 1.0 , deprecated, renamed: " init(capacity:initializingWith:) " )
307- @export ( implementation)
308- @_spi ( _) // TODO: Remove after no clients are using this
309- public init < E: Error > (
310- rawCapacity capacity: Int ,
311- initializingWith initializer: ( _ span: inout OutputRawSpan ) throws ( E ) -> Void
312- ) throws ( E) {
313- try self . init ( capacity: capacity, initializingWith: initializer)
314- }
315-
316284 /// Creates a new data with the specified capacity, directly initializing its storage using an output raw span.
317285 ///
318286 /// - Parameters:
0 commit comments