Skip to content

Commit ace0cbd

Browse files
authored
Merge pull request #279 from sunshinejr/fix/rename_optionaltype_empty
Rename `OptionalType.empty` to `OptionalType.__swifty_empty`
2 parents fe87fc4 + 55e327b commit ace0cbd

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
### Next
22

3+
### 5.3.0 (2021-02-24)
4+
* Renamed `OptionalType.empty` to `OptionalType.__swifty_empty`. Also removed the `OptionalType.wrapped` since it wasn't used in the framework anymore. Please note that this still shouldn't be something you rely on tho, we're gonna explore ways to remove the public `OptionalType` in a future releases. [@sunshinejr](https://github.com/sunshinejr)
5+
36
### 5.2.0 (2021-02-23)
47
* DefaultsAdapter's subscript setters are now `nonmutating`. This shouldn't change much on the client side, but it does fix the issue with simultaneous access (#241, #247). [@sunshinejr](https://github.com/sunshinejr)
58
* Added `DefaultsProviding` protocol that `DefaultsAdapter` implements. It should help with DI and creating test adapters (#268). [@sunshinejr](https://github.com/sunshinejr)

Sources/Defaults+Subscripts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public extension UserDefaults {
103103
} else if let defaultValue = key.defaultValue {
104104
return defaultValue
105105
} else {
106-
return T.T.empty
106+
return T.T.__swifty_empty
107107
}
108108
}
109109
set {

Sources/OptionalType.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ protocol OptionalTypeCheck {
2828

2929
public protocol OptionalType {
3030
associatedtype Wrapped
31-
var wrapped: Wrapped? { get }
32-
33-
static var empty: Self { get }
31+
32+
static var __swifty_empty: Self { get }
3433
}
3534

3635
extension Optional: OptionalType, OptionalTypeCheck {
37-
38-
public var wrapped: Wrapped? {
39-
return self
40-
}
41-
42-
public static var empty: Optional {
36+
public static var __swifty_empty: Optional {
4337
return nil
4438
}
4539

0 commit comments

Comments
 (0)