Skip to content

Commit c416e01

Browse files
committed
Improve name of endianness enumeration
1 parent abfc7ee commit c416e01

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

Sources/EmbeddedIntegerCollection/EmbeddedIntegerCollection.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ where
1111
/// The containing integer.
1212
public var container: Wrapped
1313
/// Which sub-word is to be treated as the first element.
14-
public let endianness: EmbeddedIteratorDirection
14+
public let endianness: EmbeddedIterationDirection
1515

1616
/// Creates a collection vending elements of the given type embedded in
1717
/// the given value,
@@ -38,7 +38,7 @@ where
3838
public init(
3939
embedding type: Element.Type = Element.self,
4040
within container: Wrapped = 0,
41-
iteratingFrom bitRange: EmbeddedIteratorDirection
41+
iteratingFrom bitRange: EmbeddedIterationDirection
4242
) {
4343
self.container = container
4444
endianness = bitRange
@@ -64,7 +64,7 @@ where
6464
public init(
6565
repeating element: Element,
6666
embeddedIn type: Wrapped.Type = Wrapped.self,
67-
iteratingFrom bitRange: EmbeddedIteratorDirection
67+
iteratingFrom bitRange: EmbeddedIterationDirection
6868
) {
6969
self.init(
7070
within: Wrapped(element) &* Self.allEmbeddedOnes,
@@ -75,7 +75,7 @@ where
7575

7676
/// Indicator for which direction embedded integer elements should be
7777
/// read within their containing integer.
78-
public enum EmbeddedIteratorDirection: Codable, Sendable, BitwiseCopyable {
78+
public enum EmbeddedIterationDirection: Codable, Sendable, BitwiseCopyable {
7979
/// Use the highest sub-word as the first element.
8080
///
8181
/// Subsequent elements will be at progressively lower bit offsets.
@@ -86,7 +86,7 @@ public enum EmbeddedIteratorDirection: Codable, Sendable, BitwiseCopyable {
8686
case leastSignificantFirst
8787
}
8888

89-
extension EmbeddedIteratorDirection: CaseIterable {}
89+
extension EmbeddedIterationDirection: CaseIterable {}
9090

9191
// MARK: Base Behaviors
9292

@@ -431,7 +431,7 @@ extension EmbeddedIntegerCollection {
431431
public init?<T: IteratorProtocol<Element>>(
432432
extractingFrom iterator: inout T,
433433
embeddingInto type: Wrapped.Type = Wrapped.self,
434-
fillingFrom bitRange: EmbeddedIteratorDirection
434+
fillingFrom bitRange: EmbeddedIterationDirection
435435
) {
436436
self.init(iteratingFrom: bitRange)
437437

@@ -487,7 +487,7 @@ extension EmbeddedIntegerCollection {
487487
readingFrom sequence: T,
488488
embeddingInto type: Wrapped.Type = Wrapped.self,
489489
requireEverythingRead readAll: Bool,
490-
fillingFrom bitRange: EmbeddedIteratorDirection
490+
fillingFrom bitRange: EmbeddedIterationDirection
491491
) {
492492
var iterator = sequence.makeIterator()
493493
self.init(

Tests/EmbeddedIntegerCollectionTests/EmbeddedIntegerCollectionTests.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ func basicCollections(
149149

150150
@Test(
151151
"More random-access index checks",
152-
arguments: EmbeddedIteratorDirection.allCases
152+
arguments: EmbeddedIterationDirection.allCases
153153
)
154-
func moreIndexChecks(_ startingBitRange: EmbeddedIteratorDirection) async throws
154+
func moreIndexChecks(_ startingBitRange: EmbeddedIterationDirection)
155+
async throws
155156
{
156157
let collection = EmbeddedIntegerCollection(
157158
embedding: UInt8.self,
@@ -213,8 +214,8 @@ func moreIndexChecks(_ startingBitRange: EmbeddedIteratorDirection) async throws
213214
#expect(manualIndices.elementsEqual(collectionIndices))
214215
}
215216

216-
@Test("Element swapping", arguments: EmbeddedIteratorDirection.allCases)
217-
func elementSwap(_ startingBitRange: EmbeddedIteratorDirection) async throws {
217+
@Test("Element swapping", arguments: EmbeddedIterationDirection.allCases)
218+
func elementSwap(_ startingBitRange: EmbeddedIterationDirection) async throws {
218219
var collection = EmbeddedIntegerCollection<UInt32, UInt8>(
219220
iteratingFrom: startingBitRange
220221
)
@@ -241,10 +242,10 @@ func elementSwap(_ startingBitRange: EmbeddedIteratorDirection) async throws {
241242

242243
@Test(
243244
"Arbitrary sequence reading",
244-
arguments: EmbeddedIteratorDirection.allCases
245+
arguments: EmbeddedIterationDirection.allCases
245246
)
246247
func sequenceInitialization(
247-
_ startingBitRange: EmbeddedIteratorDirection
248+
_ startingBitRange: EmbeddedIterationDirection
248249
) async throws {
249250
typealias Collection = EmbeddedIntegerCollection<UInt32, UInt8>
250251
let normalFullCollection = try #require(

0 commit comments

Comments
 (0)