Skip to content

[Source Break] Making all collection/sequence wrappers base properties internal #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/Algorithms/Chain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public struct Chain2<Base1: Sequence, Base2: Sequence>
where Base1.Element == Base2.Element
{
/// The first sequence in this chain.
public let base1: Base1
@usableFromInline
internal let base1: Base1

/// The second sequence in this chain.
public let base2: Base2
@usableFromInline
internal let base2: Base2

@usableFromInline
internal init(base1: Base1, base2: Base2) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Algorithms/Chunked.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
/// predicate or projection.
public struct LazyChunked<Base: Collection, Subject> {
/// The collection that this instance provides a view onto.
public let base: Base
@usableFromInline
internal let base: Base

/// The projection function.
@usableFromInline
Expand Down
3 changes: 2 additions & 1 deletion Sources/Algorithms/Combinations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/// A collection wrapper that generates combinations of a base collection.
public struct Combinations<Base: Collection> {
/// The collection to iterate over for combinations.
public let base: Base
@usableFromInline
internal let base: Base

@usableFromInline
internal let baseCount: Int
Expand Down
7 changes: 4 additions & 3 deletions Sources/Algorithms/Cycle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/// A collection wrapper that repeats the elements of a base collection.
public struct Cycle<Base: Collection> {
/// The collection to repeat.
public let base: Base
@usableFromInline
internal let base: Base

@usableFromInline
internal init(base: Base) {
Expand All @@ -24,10 +25,10 @@ extension Cycle: Sequence {
/// The iterator for a `Cycle` sequence.
public struct Iterator: IteratorProtocol {
@usableFromInline
let base: Base
internal let base: Base

@usableFromInline
var current: Base.Index
internal var current: Base.Index

@usableFromInline
internal init(base: Base) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Algorithms/Indexed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public struct Indexed<Base: Collection> {
public typealias Element = (index: Base.Index, element: Base.Element)

/// The base collection.
public let base: Base
@usableFromInline
internal let base: Base

@usableFromInline
internal init(base: Base) {
Expand Down
5 changes: 3 additions & 2 deletions Sources/Algorithms/Permutations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/// A sequence of all the permutations of a collection's elements.
public struct Permutations<Base: Collection> {
/// The base collection to iterate over for permutations.
public let base: Base
@usableFromInline
internal let base: Base

@usableFromInline
internal let baseCount: Int
Expand Down Expand Up @@ -71,7 +72,7 @@ extension Permutations: Sequence {
/// The iterator for a `Permutations` instance.
public struct Iterator: IteratorProtocol {
@usableFromInline
internal var base: Base
internal let base: Base

@usableFromInline
internal let baseCount: Int
Expand Down
7 changes: 5 additions & 2 deletions Sources/Algorithms/Product.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
/// A sequence that represents the product of two sequences' elements.
public struct Product2<Base1: Sequence, Base2: Collection> {
/// The outer sequence in the product.
public let base1: Base1
@usableFromInline
internal let base1: Base1

/// The inner sequence in the product.
public let base2: Base2
@usableFromInline
internal let base2: Base2

@usableFromInline
internal init(_ base1: Base1, _ base2: Base2) {
Expand Down
7 changes: 5 additions & 2 deletions Sources/Algorithms/Windows.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ extension Collection {
/// A collection wrapper that presents a sliding window over the elements of
/// a collection.
public struct Windows<Base: Collection> {
public let base: Base
public let size: Int
@usableFromInline
internal let base: Base

@usableFromInline
internal let size: Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here: does size need to be made internal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LucianoPAlmeida I take it the 👍 indicates that you'd agree with reverting this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I just thought that it was the same topic as the on going discussion above... that's why I just reacted and didn't respond here :)


@usableFromInline
internal var firstUpperBound: Base.Index?
Expand Down