Skip to content

Commit 8d2b4ca

Browse files
committed
Migrate to Swift 3.0
1 parent aeb9195 commit 8d2b4ca

26 files changed

+1116
-1070
lines changed

Sources/EventType.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ public protocol EventType: Hashable {}
1313
/// `EventType` wrapper for handling `.Any` event.
1414
public enum Event<E: EventType>
1515
{
16-
case Some(E)
17-
case Any
16+
case some(E)
17+
case any
1818
}
1919

2020
extension Event: Hashable
2121
{
2222
public var hashValue: Int
2323
{
2424
switch self {
25-
case .Some(let x): return x.hashValue
26-
case .Any: return _hashValueForAny
25+
case .some(let x): return x.hashValue
26+
case .any: return _hashValueForAny
2727
}
2828
}
2929
}
@@ -33,17 +33,17 @@ extension Event: RawRepresentable
3333
public init(rawValue: E?)
3434
{
3535
if let rawValue = rawValue {
36-
self = .Some(rawValue)
36+
self = .some(rawValue)
3737
}
3838
else {
39-
self = .Any
39+
self = .any
4040
}
4141
}
4242

4343
public var rawValue: E?
4444
{
4545
switch self {
46-
case .Some(let x): return x
46+
case .some(let x): return x
4747
default: return nil
4848
}
4949
}
@@ -52,9 +52,9 @@ extension Event: RawRepresentable
5252
public func == <E: EventType>(lhs: Event<E>, rhs: Event<E>) -> Bool
5353
{
5454
switch (lhs, rhs) {
55-
case let (.Some(x1), .Some(x2)) where x1 == x2:
55+
case let (.some(x1), .some(x2)) where x1 == x2:
5656
return true
57-
case (.Any, .Any):
57+
case (.any, .any):
5858
return true
5959
default:
6060
return false
@@ -64,19 +64,19 @@ public func == <E: EventType>(lhs: Event<E>, rhs: Event<E>) -> Bool
6464
public func == <E: EventType>(lhs: Event<E>, rhs: E) -> Bool
6565
{
6666
switch lhs {
67-
case .Some(let x):
67+
case .some(let x):
6868
return x == rhs
69-
case .Any:
69+
case .any:
7070
return false
7171
}
7272
}
7373

7474
public func == <E: EventType>(lhs: E, rhs: Event<E>) -> Bool
7575
{
7676
switch rhs {
77-
case .Some(let x):
77+
case .some(let x):
7878
return x == lhs
79-
case .Any:
79+
case .any:
8080
return false
8181
}
8282
}

0 commit comments

Comments
 (0)