Skip to content

Commit 13c5d27

Browse files
committed
[SE-0525] rename parameter to elementCount
The original label “elements” seems like it’s a container, rather than a count. `elementCount` is obviously a count of elements.
1 parent 1c910fb commit 13c5d27

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

proposals/0525-rawspan-safe-loading-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,25 +231,25 @@ The existing `bytes` and `mutableBytes` accessors will have safe overloads for w
231231
extension OutputRawSpan {
232232
@_lifetime(copy self)
233233
mutating func append<T, E: Error>(
234-
elements n: Int,
234+
elementCount n: Int,
235235
as type: T.Type,
236236
initializingWith initializer: (inout OutputSpan<T>) throws(E) -> Void
237237
) throws(E) where T: ConvertibleToBytes & BitwiseCopyable
238238
}
239239
```
240-
`append(elements:as:initializingWith:)` will perform bounds-checking and alignment-checking before executing the closure, trapping at runtime if the alignment is incorrect or if available space is insufficient.
240+
`append(elementCount:as:initializingWith:)` will perform bounds-checking and alignment-checking before executing the closure, trapping at runtime if the alignment is incorrect or if available space is insufficient.
241241

242242
Similarly, `OutputSpan` will provide a way to initialize a portion of its uninitialized storage using an `OutputRawSpan`, when its `Element` type conforms to `ConvertibleFromBytes`.
243243
```swift
244244
extension OutputSpan {
245245
@_lifetime(copy self)
246246
mutating func append<E: Error>(
247-
elements n: Int,
247+
elementCount n: Int,
248248
initializingWith initializer: (inout OutputRawSpan) throws(E) -> Void
249249
) throws(E) where Element: ConvertibleFromBytes
250250
}
251251
```
252-
`append(elements:initializingWith:)` will perform bounds-checking before executing the closure and, after it returns, will ensure that the number of bytes initialized is correct for the type of `Element`.
252+
`append(elementCount:initializingWith:)` will perform bounds-checking before executing the closure and, after it returns, will ensure that the number of bytes initialized is correct for the type of `Element`.
253253

254254
## Detailed design
255255

0 commit comments

Comments
 (0)