Skip to content

Commit 1c37ab2

Browse files
tonyarnoldfreak4pc
authored andcommitted
Remove the redundant public access modifiers on already public extensions (#70)
1 parent eaf5d7c commit 1c37ab2

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

Source/Observable+Occupiable.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public extension ObservableType where E: Occupiable {
88
- returns: `Observable` of source `Observable`'s occupiable elements, with empty occupiable elements filtered out.
99
*/
1010

11-
public func filterEmpty() -> Observable<E> {
11+
func filterEmpty() -> Observable<E> {
1212
return self.flatMap { element -> Observable<E> in
1313
guard element.isNotEmpty else {
1414
return Observable<E>.empty()
@@ -25,7 +25,7 @@ public extension ObservableType where E: Occupiable {
2525
- returns: `Observable` of the source `Observable`'s occupiable elements, with empty occupiable elements replaced by the handler's returned non-empty occupiable elements.
2626
*/
2727

28-
public func catchOnEmpty(_ handler: @escaping () throws -> Observable<E>) -> Observable<E> {
28+
func catchOnEmpty(_ handler: @escaping () throws -> Observable<E>) -> Observable<E> {
2929
return self.flatMap { element -> Observable<E> in
3030
guard element.isNotEmpty else {
3131
return try handler()
@@ -44,7 +44,7 @@ public extension ObservableType where E: Occupiable {
4444
- returns: original source `Observable` of non-empty occupiable elements if it contains no empty occupiable elements.
4545
*/
4646

47-
public func errorOnEmpty(_ error: Error = RxOptionalError.emptyOccupiable(E.self)) -> Observable<E> {
47+
func errorOnEmpty(_ error: Error = RxOptionalError.emptyOccupiable(E.self)) -> Observable<E> {
4848
return self.map { element in
4949
guard element.isNotEmpty else {
5050
throw error

Source/Observable+Optional.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public extension ObservableType where E: OptionalType {
1111
- returns: `Observable` of source `Observable`'s elements, with `nil` elements filtered out.
1212
*/
1313

14-
public func filterNil() -> Observable<E.Wrapped> {
14+
func filterNil() -> Observable<E.Wrapped> {
1515
return self.flatMap { element -> Observable<E.Wrapped> in
1616
guard let value = element.value else {
1717
return Observable<E.Wrapped>.empty()
@@ -28,7 +28,7 @@ public extension ObservableType where E: OptionalType {
2828
- returns: `Observable` of source `Observable`'s elements, with `nil` elements filtered out.
2929
*/
3030

31-
public func filterNilKeepOptional() -> Observable<E> {
31+
func filterNilKeepOptional() -> Observable<E> {
3232
return self.filter { element -> Bool in
3333
return element.value != nil
3434
}
@@ -44,7 +44,7 @@ public extension ObservableType where E: OptionalType {
4444
- returns: original source `Observable` of non-empty elements if it contains no empty elements.
4545
*/
4646

47-
public func errorOnNil(_ error: Error = RxOptionalError.foundNilWhileUnwrappingOptional(E.self)) -> Observable<E.Wrapped> {
47+
func errorOnNil(_ error: Error = RxOptionalError.foundNilWhileUnwrappingOptional(E.self)) -> Observable<E.Wrapped> {
4848
return self.map { element -> E.Wrapped in
4949
guard let value = element.value else {
5050
throw error
@@ -61,7 +61,7 @@ public extension ObservableType where E: OptionalType {
6161
- returns: `Observable` of the source `Observable`'s unwrapped elements, with `nil` elements replaced by `valueOnNil`.
6262
*/
6363

64-
public func replaceNilWith(_ valueOnNil: E.Wrapped) -> Observable<E.Wrapped> {
64+
func replaceNilWith(_ valueOnNil: E.Wrapped) -> Observable<E.Wrapped> {
6565
return self.map { element -> E.Wrapped in
6666
guard let value = element.value else {
6767
return valueOnNil
@@ -78,7 +78,7 @@ public extension ObservableType where E: OptionalType {
7878
- returns: `Observable` of the source `Observable`'s unwrapped elements, with `nil` elements replaced by the handler's returned non-`nil` elements.
7979
*/
8080

81-
public func catchOnNil(_ handler: @escaping () throws -> Observable<E.Wrapped>) -> Observable<E.Wrapped> {
81+
func catchOnNil(_ handler: @escaping () throws -> Observable<E.Wrapped>) -> Observable<E.Wrapped> {
8282
return self.flatMap { element -> Observable<E.Wrapped> in
8383
guard let value = element.value else {
8484
return try handler()
@@ -98,7 +98,7 @@ public extension ObservableType where E: OptionalType, E.Wrapped: Equatable {
9898
- returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence.
9999
*/
100100

101-
public func distinctUntilChanged() -> Observable<Self.E> {
101+
func distinctUntilChanged() -> Observable<Self.E> {
102102
return self.distinctUntilChanged { (lhs, rhs) -> Bool in
103103
return lhs.value == rhs.value
104104
}

Source/Occupiable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public protocol Occupiable {
1010
}
1111

1212
public extension Occupiable {
13-
public var isNotEmpty: Bool {
13+
var isNotEmpty: Bool {
1414
return !isEmpty
1515
}
1616
}

Source/SharedSequence+Occupiable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public extension SharedSequenceConvertibleType where E: Occupiable {
88
- returns: `Driver` of source `Driver`'s elements, with empty elements filtered out.
99
*/
1010

11-
public func filterEmpty() -> SharedSequence<SharingStrategy,E> {
11+
func filterEmpty() -> SharedSequence<SharingStrategy,E> {
1212
return flatMap { element -> SharedSequence<SharingStrategy,E> in
1313
guard element.isNotEmpty else {
1414
return SharedSequence<SharingStrategy,E>.empty()
@@ -25,7 +25,7 @@ public extension SharedSequenceConvertibleType where E: Occupiable {
2525
- returns: `Driver` of the source `Driver`'s elements, with empty elements replaced by the handler's returned non-empty elements.
2626
*/
2727

28-
public func catchOnEmpty(_ handler: @escaping () -> SharedSequence<SharingStrategy,E>) -> SharedSequence<SharingStrategy,E> {
28+
func catchOnEmpty(_ handler: @escaping () -> SharedSequence<SharingStrategy,E>) -> SharedSequence<SharingStrategy,E> {
2929
return flatMap { element -> SharedSequence<SharingStrategy,E> in
3030
guard element.isNotEmpty else {
3131
return handler()

Source/SharedSequence+Optional.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public extension SharedSequenceConvertibleType where E: OptionalType {
77
- returns: `Driver` of source `Driver`'s elements, with `nil` elements filtered out.
88
*/
99

10-
public func filterNil() -> SharedSequence<SharingStrategy,E.Wrapped> {
10+
func filterNil() -> SharedSequence<SharingStrategy,E.Wrapped> {
1111
return flatMap { element -> SharedSequence<SharingStrategy,E.Wrapped> in
1212
guard let value = element.value else {
1313
return SharedSequence<SharingStrategy,E.Wrapped>.empty()
@@ -24,7 +24,7 @@ public extension SharedSequenceConvertibleType where E: OptionalType {
2424
- returns: `Driver` of the source `Driver`'s unwrapped elements, with `nil` elements replaced by `valueOnNil`.
2525
*/
2626

27-
public func replaceNilWith(_ valueOnNil: E.Wrapped) -> SharedSequence<SharingStrategy,E.Wrapped> {
27+
func replaceNilWith(_ valueOnNil: E.Wrapped) -> SharedSequence<SharingStrategy,E.Wrapped> {
2828
return map { element -> E.Wrapped in
2929
guard let value = element.value else {
3030
return valueOnNil
@@ -41,7 +41,7 @@ public extension SharedSequenceConvertibleType where E: OptionalType {
4141
- returns: `Driver` of the source `Driver`'s unwrapped elements, with `nil` elements replaced by the handler's returned non-`nil` elements.
4242
*/
4343

44-
public func catchOnNil(_ handler: @escaping () -> SharedSequence<SharingStrategy,E.Wrapped>) -> SharedSequence<SharingStrategy,E.Wrapped> {
44+
func catchOnNil(_ handler: @escaping () -> SharedSequence<SharingStrategy,E.Wrapped>) -> SharedSequence<SharingStrategy,E.Wrapped> {
4545
return flatMap { element -> SharedSequence<SharingStrategy,E.Wrapped> in
4646
guard let value = element.value else {
4747
return handler()
@@ -61,7 +61,7 @@ public extension SharedSequenceConvertibleType where E: OptionalType, E.Wrapped:
6161
- returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence.
6262
*/
6363

64-
public func distinctUntilChanged() -> SharedSequence<SharingStrategy,E> {
64+
func distinctUntilChanged() -> SharedSequence<SharingStrategy,E> {
6565
return self.distinctUntilChanged { (lhs, rhs) -> Bool in
6666
return lhs.value == rhs.value
6767
}

0 commit comments

Comments
 (0)