Skip to content

Renaming Streamable => TextOutputStreamable #590

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
Aug 8, 2016
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: 3 additions & 3 deletions Sources/Basic/OutputByteStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public class OutputByteStream: TextOutputStream {
}

/// Write an arbitrary streamable to the buffer.
public final func write(_ value: Streamable) {
public final func write(_ value: TextOutputStreamable) {
// Get a mutable reference.
var stream: OutputByteStream = self
value.write(to: &stream)
Expand Down Expand Up @@ -260,7 +260,7 @@ precedencegroup StreamingPrecedence {
//
// NOTE: It would be nice to use a protocol here and the adopt it by all the
// things we can efficiently stream out. However, that doesn't work because we
// ultimately need to provide a manual overload sometimes, e.g., Streamable, but
// ultimately need to provide a manual overload sometimes, e.g., TextOutputStreamable, but
// that will then cause ambiguous lookup versus the implementation just using
// the defined protocol.

Expand Down Expand Up @@ -318,7 +318,7 @@ public func <<<(stream: OutputByteStream, value: ByteStreamable) -> OutputByteSt
}

@discardableResult
public func <<<(stream: OutputByteStream, value: Streamable) -> OutputByteStream {
public func <<<(stream: OutputByteStream, value: TextOutputStreamable) -> OutputByteStream {
stream.write(value)
return stream
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/BasicTests/OutputByteStreamTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OutputByteStreamTests: XCTestCase {
stream.write([UInt8]("wor".utf8))
stream.write([UInt8]("world".utf8)[3..<5])

let streamable: Streamable = Character("!")
let streamable: TextOutputStreamable = Character("!")
stream.write(streamable)


Expand All @@ -34,7 +34,7 @@ class OutputByteStreamTests: XCTestCase {
func testStreamOperator() {
let stream = BufferedOutputByteStream()

let streamable: Streamable = Character("!")
let streamable: TextOutputStreamable = Character("!")
stream <<< "Hello" <<< Character(",") <<< Character(" ") <<< [UInt8]("wor".utf8) <<< [UInt8]("world".utf8)[3..<5] <<< streamable

XCTAssertEqual(stream.position, "Hello, world!".utf8.count)
Expand Down