@@ -156,6 +156,7 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
156
156
/// - Returns: A typed buffer referencing the initialized elements.
157
157
/// The returned buffer references memory starting at the same
158
158
/// base address as this slice, and its count is equal to `source.count`.
159
+ @discardableResult
159
160
@inlinable
160
161
@_alwaysEmitIntoClient
161
162
public func moveInitializeMemory< T> (
@@ -193,6 +194,7 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
193
194
/// - Returns: A typed buffer referencing the initialized elements.
194
195
/// The returned buffer references memory starting at the same
195
196
/// base address as this slice, and its count is equal to `source.count`.
197
+ @discardableResult
196
198
@inlinable
197
199
@_alwaysEmitIntoClient
198
200
public func moveInitializeMemory< T> (
@@ -720,7 +722,7 @@ extension Slice {
720
722
@_alwaysEmitIntoClient
721
723
public func initialize< S> (
722
724
from source: S
723
- ) -> ( S . Iterator , Index )
725
+ ) -> ( unwritten : S . Iterator , index : Index )
724
726
where S: Sequence , Base == UnsafeMutableBufferPointer < S . Element > {
725
727
let buffer = Base ( rebasing: self )
726
728
let ( iterator, index) = buffer. initialize ( from: source)
@@ -743,10 +745,12 @@ extension Slice {
743
745
/// as the buffer slice can hold, the returned index is equal to
744
746
/// to the slice's `endIndex`.
745
747
///
748
+ /// - Precondition: `self.count` >= `source.count`
749
+ ///
746
750
/// - Parameter source: A collection of elements to be used to
747
751
/// initialize the buffer's storage.
748
752
/// - Returns: An index to the next uninitialized element in the
749
- /// buffer slice, or `endIndex`. @discardableResult
753
+ /// buffer slice, or `endIndex`.
750
754
@inlinable
751
755
@_alwaysEmitIntoClient
752
756
public func initialize< C> (
@@ -788,7 +792,7 @@ extension Slice {
788
792
@_alwaysEmitIntoClient
789
793
public func update< S> (
790
794
from source: S
791
- ) -> ( unwritten: S . Iterator , updated : Index )
795
+ ) -> ( unwritten: S . Iterator , index : Index )
792
796
where S: Sequence , Base == UnsafeMutableBufferPointer < S . Element > {
793
797
let buffer = Base ( rebasing: self )
794
798
let ( iterator, index) = buffer. update ( from: source)
0 commit comments