Skip to content

Commit 69f9a45

Browse files
authored
Update swiftformat to 0.44.6 (#5263)
1 parent e7e4414 commit 69f9a45

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

FirebaseStorageSwift/Tests/Integration/StorageIntegration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class StorageIntegration: XCTestCase {
116116
let data = try XCTUnwrap("Hello Swift World".data(using: .utf8), "Data construction failed")
117117
ref.putData(data) { result in
118118
self.assertResultSuccess(result)
119-
ref.delete() { error in
119+
ref.delete { error in
120120
XCTAssertNil(error, "Error should be nil")
121121
}
122122
expectation.fulfill()

Firestore/third_party/FirestoreEncoder/FirestoreDecoder.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class _FirestoreDecoder: Decoder {
9292
debugDescription: "Cannot get keyed decoding container -- found null value instead."))
9393
}
9494

95-
guard let topContainer = self.storage.topContainer as? [String: Any] else {
95+
guard let topContainer = storage.topContainer as? [String: Any] else {
9696
let context = DecodingError.Context(codingPath: codingPath, debugDescription: "Not a dictionary")
9797
throw DecodingError.typeMismatch([String: Any].self, context)
9898
}
@@ -108,7 +108,7 @@ class _FirestoreDecoder: Decoder {
108108
debugDescription: "Cannot get unkeyed decoding container -- found null value instead."))
109109
}
110110

111-
guard let topContainer = self.storage.topContainer as? [Any] else {
111+
guard let topContainer = storage.topContainer as? [Any] else {
112112
let context = DecodingError.Context(codingPath: codingPath, debugDescription: "Not an array")
113113
throw DecodingError.typeMismatch([Any].self, context)
114114
}
@@ -363,7 +363,7 @@ private struct _FirestoreKeyedDecodingContainer<K: CodingKey>: KeyedDecodingCont
363363
}
364364

365365
private func require(key: Key) throws -> Any {
366-
if let entry = self.container[key.stringValue] {
366+
if let entry = container[key.stringValue] {
367367
return entry
368368
}
369369

@@ -404,7 +404,7 @@ private struct _FirestoreKeyedDecodingContainer<K: CodingKey>: KeyedDecodingCont
404404
decoder.codingPath.append(key)
405405
defer { self.decoder.codingPath.removeLast() }
406406

407-
guard let value = self.container[key.stringValue] else {
407+
guard let value = container[key.stringValue] else {
408408
throw DecodingError.valueNotFound(UnkeyedDecodingContainer.self,
409409
DecodingError.Context(codingPath: codingPath,
410410
debugDescription: "Cannot get nested unkeyed container -- no value found for key \"\(key.stringValue)\""))
@@ -637,7 +637,7 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
637637

638638
try expectNotAtEnd()
639639

640-
let value = self.container[self.currentIndex]
640+
let value = self.container[currentIndex]
641641
try requireNotNSNull(value)
642642

643643
guard let dictionary = value as? [String: Any] else {
@@ -655,7 +655,7 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
655655

656656
try expectNotAtEnd()
657657

658-
let value = container[self.currentIndex]
658+
let value = container[currentIndex]
659659
try requireNotNSNull(value)
660660

661661
guard let array = value as? [Any] else {
@@ -672,14 +672,14 @@ private struct _FirestoreUnkeyedDecodingContainer: UnkeyedDecodingContainer {
672672

673673
try expectNotAtEnd()
674674

675-
let value = container[self.currentIndex]
675+
let value = container[currentIndex]
676676
currentIndex += 1
677677
return _FirestoreDecoder(referencing: value, at: decoder.codingPath)
678678
}
679679

680680
private func expectNotAtEnd() throws {
681681
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."))
683683
}
684684
}
685685

@@ -1040,15 +1040,15 @@ extension _FirestoreDecoder {
10401040

10411041
func unbox<T: Decodable>(_ value: Any, as _: T.Type) throws -> T? {
10421042
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 }
10441044
return (date as! T)
10451045
}
10461046
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 }
10481048
return (data as! T)
10491049
}
10501050
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 {
10521052
return nil
10531053
}
10541054
guard let url = URL(string: urlString) else {
@@ -1058,7 +1058,7 @@ extension _FirestoreDecoder {
10581058
return (url as! T)
10591059
}
10601060
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 }
10621062
return (decimal as! T)
10631063
}
10641064
if let v = value as? T {

Firestore/third_party/FirestoreEncoder/FirestoreEncoder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private class _FirestoreEncoder: Encoder {
9898
// We haven't yet pushed a container at this level; do so here.
9999
topContainer = storage.pushKeyedContainer()
100100
} else {
101-
guard let container = self.storage.containers.last as? NSMutableDictionary else {
101+
guard let container = storage.containers.last as? NSMutableDictionary else {
102102
preconditionFailure("Attempt to push new keyed encoding container when already previously encoded at this path.")
103103
}
104104

@@ -116,7 +116,7 @@ private class _FirestoreEncoder: Encoder {
116116
// We haven't yet pushed a container at this level; do so here.
117117
topContainer = storage.pushUnkeyedContainer()
118118
} else {
119-
guard let container = self.storage.containers.last as? NSMutableArray else {
119+
guard let container = storage.containers.last as? NSMutableArray else {
120120
preconditionFailure("Attempt to push new unkeyed encoding container when already previously encoded at this path.")
121121
}
122122

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ These commands will get the right versions:
124124

125125
```
126126
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb
127-
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb
127+
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/c13eda8/Formula/swiftformat.rb
128128
```
129129

130130
Note: if you already have a newer version of these installed you may need to

scripts/setup_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export HOMEBREW_NO_ANALYTICS=1
2222
export HOMEBREW_NO_AUTO_UPDATE=1
2323

2424
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb
25-
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb
25+
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c13eda8/Formula/swiftformat.rb
2626

2727
pip install flake8
2828

0 commit comments

Comments
 (0)