Skip to content

Commit 209609a

Browse files
Making base properties on collection wrappers all internal
1 parent d91723b commit 209609a

File tree

9 files changed

+38
-16
lines changed

9 files changed

+38
-16
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
internal init(base1: Base1, base2: Base2) {
2325
self.base1 = base1

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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,23 @@
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
17+
18+
@usableFromInline
19+
internal init(base: Base) {
20+
self.base = base
21+
}
1622
}
1723

1824
extension Cycle: Sequence {
1925
/// The iterator for a `Cycle` sequence.
2026
public struct Iterator: IteratorProtocol {
2127
@usableFromInline
22-
let base: Base
28+
internal let base: Base
2329

2430
@usableFromInline
25-
var current: Base.Index
31+
internal var current: Base.Index
2632

2733
@usableFromInline
2834
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
@usableFromInline
2223
internal init(base: Base) {

Sources/Algorithms/Intersperse.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
/// A sequence that presents the elements of a base sequence of elements
1313
/// with a separator between each of those elements.
1414
public struct Intersperse<Base: Sequence> {
15-
let base: Base
16-
let separator: Base.Element
15+
@usableFromInline
16+
internal let base: Base
17+
18+
@usableFromInline
19+
internal let separator: Base.Element
20+
1721
}
1822

1923
extension Intersperse: Sequence {

Sources/Algorithms/Permutations.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
/// A sequence of all the permutations of a collection's elements.
1313
public struct Permutations<Base: Collection> {
1414
/// The base collection to iterate over for permutations.
15-
public let base: Base
15+
@usableFromInline
16+
internal let base: Base
1617

1718
@usableFromInline
1819
internal let baseCount: Int
@@ -71,7 +72,7 @@ extension Permutations: Sequence {
7172
/// The iterator for a `Permutations` instance.
7273
public struct Iterator: IteratorProtocol {
7374
@usableFromInline
74-
internal var base: Base
75+
internal let base: Base
7576

7677
@usableFromInline
7778
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
internal init(_ base1: Base1, _ base2: Base2) {
2023
self.base1 = base1

Sources/Algorithms/Windows.swift

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

5255
internal var firstUpperBound: Base.Index?
5356

0 commit comments

Comments
 (0)