Skip to content

Commit ea7a846

Browse files
committed
Delete a bunch of unneeded mutating keywords on BinaryEncoder's nested types.
1 parent 8f9b46d commit ea7a846

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

BinaryEncoder.swift

+10-10
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,23 @@ extension BinaryEncoder: Encoder {
102102

103103
var codingPath: [CodingKey?] { return [] }
104104

105-
mutating func encode<T>(_ value: T, forKey key: Key) throws where T : Encodable {
105+
func encode<T>(_ value: T, forKey key: Key) throws where T : Encodable {
106106
try encoder.encode(value)
107107
}
108108

109-
mutating func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type, forKey key: Key) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
109+
func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type, forKey key: Key) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
110110
return encoder.container(keyedBy: keyType)
111111
}
112112

113-
mutating func nestedUnkeyedContainer(forKey key: Key) -> UnkeyedEncodingContainer {
113+
func nestedUnkeyedContainer(forKey key: Key) -> UnkeyedEncodingContainer {
114114
return encoder.unkeyedContainer()
115115
}
116116

117-
mutating func superEncoder() -> Encoder {
117+
func superEncoder() -> Encoder {
118118
return encoder
119119
}
120120

121-
mutating func superEncoder(forKey key: Key) -> Encoder {
121+
func superEncoder(forKey key: Key) -> Encoder {
122122
return encoder
123123
}
124124
}
@@ -128,22 +128,22 @@ extension BinaryEncoder: Encoder {
128128

129129
var codingPath: [CodingKey?] { return [] }
130130

131-
mutating func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
131+
func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type) -> KeyedEncodingContainer<NestedKey> where NestedKey : CodingKey {
132132
return encoder.container(keyedBy: keyType)
133133
}
134134

135-
mutating func nestedUnkeyedContainer() -> UnkeyedEncodingContainer {
135+
func nestedUnkeyedContainer() -> UnkeyedEncodingContainer {
136136
return self
137137
}
138138

139-
mutating func superEncoder() -> Encoder {
139+
func superEncoder() -> Encoder {
140140
return encoder
141141
}
142142

143-
mutating func encodeNil() throws {
143+
func encodeNil() throws {
144144
}
145145

146-
mutating func encode<T>(_ value: T) throws where T : Encodable {
146+
func encode<T>(_ value: T) throws where T : Encodable {
147147
try encoder.encode(value)
148148
}
149149
}

0 commit comments

Comments
 (0)