Skip to content
Open
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
2 changes: 1 addition & 1 deletion swift/lib/ProtocGenSwift/ProtocGenSwift/JSONWriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class JSONWriter : Writer {
var tag: Int! = nil
var isRepeatedStack: [Bool] = []

public class func withCapacity(capacity: Int) throws -> Writer {
public class func withCapacity(capacity: Int) -> Writer {
return JSONWriter()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ProtocGenSwiftTests: XCTestCase {

func testJSON() {
do {
let writer = try JSONWriter.withCapacity(demoMessage.sizeInBytes)
let writer = JSONWriter.withCapacity(demoMessage.sizeInBytes)
demoMessage.toWriter(writer)
let buffer = try writer.toBuffer()
let jsonString = NSString(data: buffer, encoding: NSUTF8StringEncoding)
Expand All @@ -56,7 +56,7 @@ class ProtocGenSwiftTests: XCTestCase {

func testJSONReadArray() {
do {
let writer = try JSONWriter.withCapacity(demoMessageWithEmptyNestedArray.sizeInBytes)
let writer = JSONWriter.withCapacity(demoMessageWithEmptyNestedArray.sizeInBytes)
demoMessageWithEmptyNestedArray.toWriter(writer)
let jsonString = "{\"demoRepeatedNestedMessage\":[]}"
let jsonData = jsonString.dataUsingEncoding(NSUTF8StringEncoding)!
Expand Down