Skip to content

Commit

Permalink
Fix formatter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Mar 22, 2020
1 parent 2bffb8f commit e4ac62c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions Dangerfile.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import Danger

SwiftLint.lint(
inline: true,
configFile: ".swiftlint.yml",
strict: true
)
SwiftLint.lint(inline: true, configFile: ".swiftlint.yml", strict: true)
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Decoder/XMLDecoderImplementation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class XMLDecoderImplementation: Decoder {
}

public func container<Key>(keyedBy keyType: Key.Type) throws -> KeyedDecodingContainer<Key> {
if let keyed = try self.topContainer() as? SharedBox<KeyedBox> {
if let keyed = try topContainer() as? SharedBox<KeyedBox> {
return KeyedDecodingContainer(XMLKeyedDecodingContainer<Key>(
referencing: self,
wrapping: keyed
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ extension XMLKeyedDecodingContainer {
_ type: T.Type,
forKey key: Key
) throws -> T {
guard let strategy = self.decoder.nodeDecodings.last else {
guard let strategy = decoder.nodeDecodings.last else {
preconditionFailure(
"""
Attempt to access node decoding strategy from empty stack.
Expand Down
8 changes: 4 additions & 4 deletions Sources/XMLCoder/Decoder/XMLUnkeyedDecodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct XMLUnkeyedDecodingContainer: UnkeyedDecodingContainer {
public mutating func decodeNil() throws -> Bool {
guard !isAtEnd else {
throw DecodingError.valueNotFound(Any?.self, DecodingError.Context(
codingPath: decoder.codingPath + [XMLKey(index: self.currentIndex)],
codingPath: decoder.codingPath + [XMLKey(index: currentIndex)],
debugDescription: "Unkeyed container is at end."
))
}
Expand All @@ -75,7 +75,7 @@ struct XMLUnkeyedDecodingContainer: UnkeyedDecodingContainer {
_ type: T.Type,
decode: (XMLDecoderImplementation, Box) throws -> T?
) throws -> T {
guard let strategy = self.decoder.nodeDecodings.last else {
guard let strategy = decoder.nodeDecodings.last else {
preconditionFailure("Attempt to access node decoding strategy from empty stack.")
}
decoder.codingPath.append(XMLKey(index: currentIndex))
Expand All @@ -90,7 +90,7 @@ struct XMLUnkeyedDecodingContainer: UnkeyedDecodingContainer {
}
guard !isAtEnd else {
throw DecodingError.valueNotFound(type, DecodingError.Context(
codingPath: decoder.codingPath + [XMLKey(index: self.currentIndex)],
codingPath: decoder.codingPath + [XMLKey(index: currentIndex)],
debugDescription: "Unkeyed container is at end."
))
}
Expand Down Expand Up @@ -128,7 +128,7 @@ struct XMLUnkeyedDecodingContainer: UnkeyedDecodingContainer {

guard let decoded: T = value else {
throw DecodingError.valueNotFound(type, DecodingError.Context(
codingPath: decoder.codingPath + [XMLKey(index: self.currentIndex)],
codingPath: decoder.codingPath + [XMLKey(index: currentIndex)],
debugDescription: "Expected \(type) but found null instead."
))
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Encoder/XMLKeyedEncodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
_ = self.encoder.nodeEncodings.removeLast()
self.encoder.codingPath.removeLast()
}
guard let strategy = self.encoder.nodeEncodings.last else {
guard let strategy = encoder.nodeEncodings.last else {
preconditionFailure(
"Attempt to access node encoding strategy from empty stack."
)
Expand Down

0 comments on commit e4ac62c

Please sign in to comment.