Skip to content

Commit a61c3db

Browse files
Making base properties on collection wrappers all internal (#85)
1 parent 198eee0 commit a61c3db

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

Sources/Algorithms/Chain.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ public struct Chain2<Base1: Sequence, Base2: Sequence>
1414
where Base1.Element == Base2.Element
1515
{
1616
/// The first sequence in this chain.
17-
public let base1: Base1
17+
@usableFromInline
18+
internal let base1: Base1
1819

1920
/// The second sequence in this chain.
20-
public let base2: Base2
21+
@usableFromInline
22+
internal let base2: Base2
2123

2224
@inlinable
2325
internal init(base1: Base1, base2: Base2) {

Sources/Algorithms/Chunked.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
/// predicate or projection.
1414
public struct LazyChunked<Base: Collection, Subject> {
1515
/// The collection that this instance provides a view onto.
16-
public let base: Base
16+
@usableFromInline
17+
internal let base: Base
1718

1819
/// The projection function.
1920
@usableFromInline

Sources/Algorithms/Combinations.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
/// A collection wrapper that generates combinations of a base collection.
1313
public struct Combinations<Base: Collection> {
1414
/// The collection to iterate over for combinations.
15-
public let base: Base
15+
@usableFromInline
16+
internal let base: Base
1617

1718
@usableFromInline
1819
internal let baseCount: Int

Sources/Algorithms/Cycle.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
/// A collection wrapper that repeats the elements of a base collection.
1313
public struct Cycle<Base: Collection> {
1414
/// The collection to repeat.
15-
public let base: Base
15+
@usableFromInline
16+
internal let base: Base
1617

1718
@inlinable
1819
internal init(base: Base) {
@@ -24,10 +25,10 @@ extension Cycle: Sequence {
2425
/// The iterator for a `Cycle` sequence.
2526
public struct Iterator: IteratorProtocol {
2627
@usableFromInline
27-
let base: Base
28+
internal let base: Base
2829

2930
@usableFromInline
30-
var current: Base.Index
31+
internal var current: Base.Index
3132

3233
@inlinable
3334
internal init(base: Base) {

Sources/Algorithms/Indexed.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public struct Indexed<Base: Collection> {
1616
public typealias Element = (index: Base.Index, element: Base.Element)
1717

1818
/// The base collection.
19-
public let base: Base
19+
@usableFromInline
20+
internal let base: Base
2021

2122
@inlinable
2223
internal init(base: Base) {

Sources/Algorithms/Permutations.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ extension MutableCollection
7878
/// A sequence of all the permutations of a collection's elements.
7979
public struct Permutations<Base: Collection> {
8080
/// The base collection to iterate over for permutations.
81-
public let base: Base
81+
@usableFromInline
82+
internal let base: Base
8283

8384
@usableFromInline
8485
internal let baseCount: Int
@@ -137,7 +138,7 @@ extension Permutations: Sequence {
137138
/// The iterator for a `Permutations` instance.
138139
public struct Iterator: IteratorProtocol {
139140
@usableFromInline
140-
internal var base: Base
141+
internal let base: Base
141142

142143
@usableFromInline
143144
internal let baseCount: Int

Sources/Algorithms/Product.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
/// A sequence that represents the product of two sequences' elements.
1313
public struct Product2<Base1: Sequence, Base2: Collection> {
1414
/// The outer sequence in the product.
15-
public let base1: Base1
15+
@usableFromInline
16+
internal let base1: Base1
17+
1618
/// The inner sequence in the product.
17-
public let base2: Base2
19+
@usableFromInline
20+
internal let base2: Base2
1821

1922
@inlinable
2023
internal init(_ base1: Base1, _ base2: Base2) {

Sources/Algorithms/Windows.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ extension Collection {
4747
/// A collection wrapper that presents a sliding window over the elements of
4848
/// a collection.
4949
public struct Windows<Base: Collection> {
50-
public let base: Base
51-
public let size: Int
50+
@usableFromInline
51+
internal let base: Base
52+
53+
@usableFromInline
54+
internal let size: Int
5255

5356
@usableFromInline
5457
internal var firstUpperBound: Base.Index?

0 commit comments

Comments
 (0)