@@ -92,7 +92,7 @@ class _FirestoreDecoder: Decoder {
92
92
debugDescription: " Cannot get keyed decoding container -- found null value instead. " ) )
93
93
}
94
94
95
- guard let topContainer = self . storage. topContainer as? [ String : Any ] else {
95
+ guard let topContainer = storage. topContainer as? [ String : Any ] else {
96
96
let context = DecodingError . Context ( codingPath: codingPath, debugDescription: " Not a dictionary " )
97
97
throw DecodingError . typeMismatch ( [ String : Any ] . self, context)
98
98
}
@@ -108,7 +108,7 @@ class _FirestoreDecoder: Decoder {
108
108
debugDescription: " Cannot get unkeyed decoding container -- found null value instead. " ) )
109
109
}
110
110
111
- guard let topContainer = self . storage. topContainer as? [ Any ] else {
111
+ guard let topContainer = storage. topContainer as? [ Any ] else {
112
112
let context = DecodingError . Context ( codingPath: codingPath, debugDescription: " Not an array " )
113
113
throw DecodingError . typeMismatch ( [ Any ] . self, context)
114
114
}
@@ -363,7 +363,7 @@ private struct _FirestoreKeyedDecodingContainer<K: CodingKey>: KeyedDecodingCont
363
363
}
364
364
365
365
private func require( key: Key ) throws -> Any {
366
- if let entry = self . container [ key. stringValue] {
366
+ if let entry = container [ key. stringValue] {
367
367
return entry
368
368
}
369
369
@@ -404,7 +404,7 @@ private struct _FirestoreKeyedDecodingContainer<K: CodingKey>: KeyedDecodingCont
404
404
decoder. codingPath. append ( key)
405
405
defer { self . decoder. codingPath. removeLast ( ) }
406
406
407
- guard let value = self . container [ key. stringValue] else {
407
+ guard let value = container [ key. stringValue] else {
408
408
throw DecodingError . valueNotFound ( UnkeyedDecodingContainer . self,
409
409
DecodingError . Context ( codingPath: codingPath,
410
410
debugDescription: " Cannot get nested unkeyed container -- no value found for key \" \( key. stringValue) \" " ) )
@@ -637,7 +637,7 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
637
637
638
638
try expectNotAtEnd ( )
639
639
640
- let value = self . container [ self . currentIndex]
640
+ let value = self . container [ currentIndex]
641
641
try requireNotNSNull ( value)
642
642
643
643
guard let dictionary = value as? [ String : Any ] else {
@@ -655,7 +655,7 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
655
655
656
656
try expectNotAtEnd ( )
657
657
658
- let value = container [ self . currentIndex]
658
+ let value = container [ currentIndex]
659
659
try requireNotNSNull ( value)
660
660
661
661
guard let array = value as? [ Any ] else {
@@ -672,14 +672,14 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
672
672
673
673
try expectNotAtEnd ( )
674
674
675
- let value = container [ self . currentIndex]
675
+ let value = container [ currentIndex]
676
676
currentIndex += 1
677
677
return _FirestoreDecoder ( referencing: value, at: decoder. codingPath)
678
678
}
679
679
680
680
private func expectNotAtEnd( ) throws {
681
681
guard !isAtEnd else {
682
- throw DecodingError . valueNotFound ( Any ? . self, DecodingError . Context ( codingPath: decoder. codingPath + [ _FirestoreKey ( index: self . currentIndex) ] , debugDescription: " Unkeyed container is at end. " ) )
682
+ throw DecodingError . valueNotFound ( Any ? . self, DecodingError . Context ( codingPath: decoder. codingPath + [ _FirestoreKey ( index: currentIndex) ] , debugDescription: " Unkeyed container is at end. " ) )
683
683
}
684
684
}
685
685
@@ -1040,15 +1040,15 @@ extension _FirestoreDecoder {
1040
1040
1041
1041
func unbox< T: Decodable > ( _ value: Any , as _: T . Type ) throws -> T ? {
1042
1042
if T . self == Date . self || T . self == NSDate . self {
1043
- guard let date = try self . unbox ( value, as: Date . self) else { return nil }
1043
+ guard let date = try unbox ( value, as: Date . self) else { return nil }
1044
1044
return ( date as! T )
1045
1045
}
1046
1046
if T . self == Data . self || T . self == NSData . self {
1047
- guard let data = try self . unbox ( value, as: Data . self) else { return nil }
1047
+ guard let data = try unbox ( value, as: Data . self) else { return nil }
1048
1048
return ( data as! T )
1049
1049
}
1050
1050
if T . self == URL . self || T . self == NSURL . self {
1051
- guard let urlString = try self . unbox ( value, as: String . self) else {
1051
+ guard let urlString = try unbox ( value, as: String . self) else {
1052
1052
return nil
1053
1053
}
1054
1054
guard let url = URL ( string: urlString) else {
@@ -1058,7 +1058,7 @@ extension _FirestoreDecoder {
1058
1058
return ( url as! T )
1059
1059
}
1060
1060
if T . self == Decimal . self || T . self == NSDecimalNumber . self {
1061
- guard let decimal = try self . unbox ( value, as: Decimal . self) else { return nil }
1061
+ guard let decimal = try unbox ( value, as: Decimal . self) else { return nil }
1062
1062
return ( decimal as! T )
1063
1063
}
1064
1064
if let v = value as? T {
0 commit comments