Skip to content

Commit

Permalink
Fix typo decodeFixedWithInteger() -> decodeFixedWidthInteger() (#22)
Browse files Browse the repository at this point in the history
- Fix issue #18
  • Loading branch information
fabianfett authored Mar 19, 2020
1 parent 335d0ea commit ced5198
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,43 +41,43 @@ struct JSONSingleValueDecodingContainter: SingleValueDecodingContainer {
}

func decode(_ type: Int.Type) throws -> Int {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: Int8.Type) throws -> Int8 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: Int16.Type) throws -> Int16 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: Int32.Type) throws -> Int32 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: Int64.Type) throws -> Int64 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: UInt.Type) throws -> UInt {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: UInt8.Type) throws -> UInt8 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: UInt16.Type) throws -> UInt16 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: UInt32.Type) throws -> UInt32 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode(_ type: UInt64.Type) throws -> UInt64 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

func decode<T>(_ type: T.Type) throws -> T where T : Decodable {
Expand All @@ -93,7 +93,7 @@ extension JSONSingleValueDecodingContainter {
debugDescription: "Expected to decode \(type) but found \(value.debugDataTypeDescription) instead."))
}

@inline(__always) private func decodeFixedWithInteger<T: FixedWidthInteger>() throws
@inline(__always) private func decodeFixedWidthInteger<T: FixedWidthInteger>() throws
-> T
{
guard case .number(let number) = value else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,43 @@ struct JSONUnkeyedDecodingContainer: UnkeyedDecodingContainer {
}

mutating func decode(_ type: Int.Type) throws -> Int {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: Int8.Type) throws -> Int8 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: Int16.Type) throws -> Int16 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: Int32.Type) throws -> Int32 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: Int64.Type) throws -> Int64 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: UInt.Type) throws -> UInt {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: UInt8.Type) throws -> UInt8 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: UInt16.Type) throws -> UInt16 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: UInt32.Type) throws -> UInt32 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode(_ type: UInt64.Type) throws -> UInt64 {
return try self.decodeFixedWithInteger()
return try self.decodeFixedWidthInteger()
}

mutating func decode<T>(_ type: T.Type) throws -> T where T : Decodable {
Expand Down Expand Up @@ -149,7 +149,7 @@ extension JSONUnkeyedDecodingContainer {
}


@inline(__always) private mutating func decodeFixedWithInteger<T: FixedWidthInteger>() throws
@inline(__always) private mutating func decodeFixedWidthInteger<T: FixedWidthInteger>() throws
-> T
{
defer {
Expand Down

0 comments on commit ced5198

Please # to comment.