Skip to content

Commit ced5198

Browse files
authored
Fix typo decodeFixedWithInteger() -> decodeFixedWidthInteger() (#22)
- Fix issue #18
1 parent 335d0ea commit ced5198

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

Sources/PureSwiftJSONCoding/Decoding/JSONSingleValueDecodingContainer.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,43 +41,43 @@ struct JSONSingleValueDecodingContainter: SingleValueDecodingContainer {
4141
}
4242

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

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

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

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

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

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

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

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

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

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

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

96-
@inline(__always) private func decodeFixedWithInteger<T: FixedWidthInteger>() throws
96+
@inline(__always) private func decodeFixedWidthInteger<T: FixedWidthInteger>() throws
9797
-> T
9898
{
9999
guard case .number(let number) = value else {

Sources/PureSwiftJSONCoding/Decoding/JSONUnkeyedDecodingContainer.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,43 @@ struct JSONUnkeyedDecodingContainer: UnkeyedDecodingContainer {
7272
}
7373

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

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

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

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

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

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

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

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

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

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

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

151151

152-
@inline(__always) private mutating func decodeFixedWithInteger<T: FixedWidthInteger>() throws
152+
@inline(__always) private mutating func decodeFixedWidthInteger<T: FixedWidthInteger>() throws
153153
-> T
154154
{
155155
defer {

0 commit comments

Comments
 (0)