Skip to content

Commit

Permalink
Apply SwiftFormat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Dec 22, 2018
1 parent 85254ba commit e5ef9ec
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Sources/XMLCoder/Decoder/XMLDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ open class XMLDecoder {
/// The options set on the top-level decoder.
var options: Options {
return Options(dateDecodingStrategy: dateDecodingStrategy,
dataDecodingStrategy: dataDecodingStrategy,
nonConformingFloatDecodingStrategy: nonConformingFloatDecodingStrategy,
keyDecodingStrategy: keyDecodingStrategy,
userInfo: userInfo)
dataDecodingStrategy: dataDecodingStrategy,
nonConformingFloatDecodingStrategy: nonConformingFloatDecodingStrategy,
keyDecodingStrategy: keyDecodingStrategy,
userInfo: userInfo)
}

// MARK: - Constructing a XML Decoder
Expand Down
10 changes: 5 additions & 5 deletions Sources/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ struct XMLKeyedDecodingContainer<K: CodingKey>: KeyedDecodingContainerProtocol {
let elementNotFound = (container.elements[key.stringValue] == nil)

if let type = type as? AnyEmptySequence.Type,
attributeNotFound && elementNotFound,
let result = type.init() as? T {
attributeNotFound, elementNotFound,
let result = type.init() as? T {
return result
}

Expand All @@ -206,21 +206,21 @@ struct XMLKeyedDecodingContainer<K: CodingKey>: KeyedDecodingContainerProtocol {
}

private func decodeSignedInteger<T>(_ type: T.Type, forKey key: Key) throws -> T
where T: BinaryInteger & SignedInteger & Decodable {
where T: BinaryInteger & SignedInteger & Decodable {
return try decode(type, forKey: key) { decoder, box in
try decoder.unbox(box)
}
}

private func decodeUnsignedInteger<T>(_ type: T.Type, forKey key: Key) throws -> T
where T: BinaryInteger & UnsignedInteger & Decodable {
where T: BinaryInteger & UnsignedInteger & Decodable {
return try decode(type, forKey: key) { decoder, box in
try decoder.unbox(box)
}
}

private func decodeFloatingPoint<T>(_ type: T.Type, forKey key: Key) throws -> T
where T: BinaryFloatingPoint & Decodable {
where T: BinaryFloatingPoint & Decodable {
return try decode(type, forKey: key) { decoder, box in
try decoder.unbox(box)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Decoder/XMLUnkeyedDecodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ struct XMLUnkeyedDecodingContainer: UnkeyedDecodingContainer {
}

public mutating func nestedContainer<NestedKey>(keyedBy _: NestedKey.Type) throws
-> KeyedDecodingContainer<NestedKey> {
-> KeyedDecodingContainer<NestedKey> {
decoder.codingPath.append(XMLKey(index: currentIndex))
defer { self.decoder.codingPath.removeLast() }

Expand Down
20 changes: 10 additions & 10 deletions Sources/XMLCoder/Encoder/XMLEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ open class XMLEncoder {
/// The options set on the top-level encoder.
var options: Options {
return Options(dateEncodingStrategy: dateEncodingStrategy,
dataEncodingStrategy: dataEncodingStrategy,
nonConformingFloatEncodingStrategy: nonConformingFloatEncodingStrategy,
keyEncodingStrategy: keyEncodingStrategy,
nodeEncodingStrategy: nodeEncodingStrategy,
stringEncodingStrategy: stringEncodingStrategy,
userInfo: userInfo)
dataEncodingStrategy: dataEncodingStrategy,
nonConformingFloatEncodingStrategy: nonConformingFloatEncodingStrategy,
keyEncodingStrategy: keyEncodingStrategy,
nodeEncodingStrategy: nodeEncodingStrategy,
stringEncodingStrategy: stringEncodingStrategy,
userInfo: userInfo)
}

// MARK: - Constructing a XML Encoder
Expand Down Expand Up @@ -580,16 +580,16 @@ extension XMLEncoderImplementation {

func box<T: Encodable>(_ value: T) throws -> Box {
if T.self == Date.self || T.self == NSDate.self,
let value = value as? Date {
let value = value as? Date {
return try box(value)
} else if T.self == Data.self || T.self == NSData.self,
let value = value as? Data {
let value = value as? Data {
return try box(value)
} else if T.self == URL.self || T.self == NSURL.self,
let value = value as? URL {
let value = value as? URL {
return box(value)
} else if T.self == Decimal.self || T.self == NSDecimalNumber.self,
let value = value as? Decimal {
let value = value as? Decimal {
return box(value)
}

Expand Down

0 comments on commit e5ef9ec

Please sign in to comment.