Skip to content

Commit

Permalink
Updated to Swift 07-25 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
czechboy0 authored Jul 27, 2016
1 parent 6bf4a1e commit 7a0fd97
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEVELOPMENT-SNAPSHOT-2016-06-20-a
DEVELOPMENT-SNAPSHOT-2016-07-25-a
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ os:
language: generic
sudo: required
dist: trusty
osx_image: xcode7.3
osx_image: xcode8
install:
- eval "$(curl -sL https://raw.githubusercontent.com/Zewo/Zewo/5254525d9da56df29346fd76e99529c22034d61d/Scripts/install-swiftenv.sh)"
script:
- swift build -Xlinker -rpath -Xlinker $(pwd)/.build/debug/
- swift build --configuration release -Xlinker -rpath -Xlinker $(pwd)/.build/release/
- swift build
- swift build --configuration release
- swift test
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ let package = Package(
name: "Venice",
dependencies: [
.Package(url: "https://github.com/VeniceX/CLibvenice.git", majorVersion: 0, minor: 6),
.Package(url: "https://github.com/open-swift/C7.git", majorVersion: 0, minor: 9),
.Package(url: "https://github.com/open-swift/C7.git", majorVersion: 0, minor: 10),
]
)
8 changes: 4 additions & 4 deletions Source/Venice/FallibleChannel/FallibleChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public struct FallibleChannelGenerator<T>: IteratorProtocol {

public enum ChannelResult<T> {
case value(T)
case error(ErrorProtocol)
case error(Error)

public func success(_ closure: @noescape (T) -> Void) {
switch self {
Expand All @@ -43,7 +43,7 @@ public enum ChannelResult<T> {
}
}

public func failure(_ closure: @noescape (ErrorProtocol) -> Void) {
public func failure(_ closure: @noescape (Error) -> Void) {
switch self {
case .error(let error): closure(error)
default: break
Expand Down Expand Up @@ -115,15 +115,15 @@ public final class FallibleChannel<T>: Sequence {
}

/// Send an error to the channel.
public func send(_ error: ErrorProtocol) {
public func send(_ error: Error) {
if !closed {
let result = ChannelResult<T>.error(error)
buffer.append(result)
mill_chs(channel, "FallibleChannel send")
}
}

internal func send(_ error: ErrorProtocol, clause: UnsafeMutablePointer<Void>, index: Int) {
internal func send(_ error: Error, clause: UnsafeMutablePointer<Void>, index: Int) {
if !closed {
let result = ChannelResult<T>.error(error)
buffer.append(result)
Expand Down
4 changes: 2 additions & 2 deletions Source/Venice/FallibleChannel/FallibleSendingChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public final class FallibleSendingChannel<T> {
return channel.send(value, clause: clause, index: index)
}

public func send(_ error: ErrorProtocol) {
public func send(_ error: Error) {
return channel.send(error)
}

internal func send(_ error: ErrorProtocol, clause: UnsafeMutablePointer<Void>, index: Int) {
internal func send(_ error: Error, clause: UnsafeMutablePointer<Void>, index: Int) {
return channel.send(error, clause: clause, index: index)
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Venice/Poll/Poll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import C7

public typealias FileDescriptor = Int32

public enum PollError: ErrorProtocol {
public enum PollError: Error {
case timeout
case failure
}
Expand Down
24 changes: 12 additions & 12 deletions Source/Venice/Select/Select.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ final class FallibleSendingChannelSendCase<T>: SelectCase {

final class FallibleChannelSendErrorCase<T>: SelectCase {
let channel: FallibleChannel<T>
let error: ErrorProtocol
let error: Error
let closure: (Void) -> Void

init(channel: FallibleChannel<T>, error: ErrorProtocol, closure: (Void) -> Void) {
init(channel: FallibleChannel<T>, error: Error, closure: (Void) -> Void) {
self.channel = channel
self.error = error
self.closure = closure
Expand All @@ -211,10 +211,10 @@ final class FallibleChannelSendErrorCase<T>: SelectCase {

final class FallibleSendingChannelSendErrorCase<T>: SelectCase {
let channel: FallibleSendingChannel<T>
let error: ErrorProtocol
let error: Error
let closure: (Void) -> Void

init(channel: FallibleSendingChannel<T>, error: ErrorProtocol, closure: (Void) -> Void) {
init(channel: FallibleSendingChannel<T>, error: Error, closure: (Void) -> Void) {
self.channel = channel
self.error = error
self.closure = closure
Expand Down Expand Up @@ -280,42 +280,42 @@ public class SelectCaseBuilder {
}

public func sent<T>(_ value: T, to channel: Channel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
if let channel = channel, !channel.closed {
let selectCase = ChannelSendCase(channel: channel, value: value, closure: closure)
cases.append(selectCase)
}
}

public func sent<T>(_ value: T, to channel: SendingChannel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
if let channel = channel, !channel.closed {
let selectCase = SendingChannelSendCase(channel: channel, value: value, closure: closure)
cases.append(selectCase)
}
}

public func sent<T>(_ value: T, to channel: FallibleChannel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
if let channel = channel, !channel.closed {
let selectCase = FallibleChannelSendCase(channel: channel, value: value, closure: closure)
cases.append(selectCase)
}
}

public func sent<T>(_ value: T, to channel: FallibleSendingChannel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
if let channel = channel, !channel.closed {
let selectCase = FallibleSendingChannelSendCase(channel: channel, value: value, closure: closure)
cases.append(selectCase)
}
}

public func sent<T>(_ error: ErrorProtocol, to channel: FallibleChannel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
public func sent<T>(_ error: Error, to channel: FallibleChannel<T>?, closure: (Void) -> Void) {
if let channel = channel, !channel.closed {
let selectCase = FallibleChannelSendErrorCase(channel: channel, error: error, closure: closure)
cases.append(selectCase)
}
}

public func sent<T>(_ error: ErrorProtocol, to channel: FallibleSendingChannel<T>?, closure: (Void) -> Void) {
if let channel = channel where !channel.closed {
public func sent<T>(_ error: Error, to channel: FallibleSendingChannel<T>?, closure: (Void) -> Void) {
if let channel = channel, !channel.closed {
let selectCase = FallibleSendingChannelSendErrorCase(channel: channel, error: error, closure: closure)
cases.append(selectCase)
}
Expand Down

0 comments on commit 7a0fd97

Please sign in to comment.