Skip to content

Commit 3752c2f

Browse files
authored
Remove unnecessary typealias (#9159)
1 parent 8d97b63 commit 3752c2f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

FirebaseStorageSwift/Sources/AsyncAwait.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import FirebaseStorage
2727
/// the task will be cancelled and an error will be thrown.
2828
/// - Returns: Data object.
2929
func data(maxSize: Int64) async throws -> Data {
30-
typealias DataContinuation = CheckedContinuation<Data, Error>
31-
return try await withCheckedThrowingContinuation { (continuation: DataContinuation) in
30+
return try await withCheckedThrowingContinuation { continuation in
3231
// TODO: Use task to handle progress and cancellation.
3332
_ = self.getData(maxSize: maxSize) { result in
3433
continuation.resume(with: result)
@@ -47,8 +46,7 @@ import FirebaseStorage
4746
/// - Returns: StorageMetadata with additional information about the object being uploaded.
4847
func putDataAsync(_ uploadData: Data,
4948
metadata: StorageMetadata? = nil) async throws -> StorageMetadata {
50-
typealias MetadataContinuation = CheckedContinuation<StorageMetadata, Error>
51-
return try await withCheckedThrowingContinuation { (continuation: MetadataContinuation) in
49+
return try await withCheckedThrowingContinuation { continuation in
5250
// TODO: Use task to handle progress and cancellation.
5351
_ = self.putData(uploadData, metadata: metadata) { result in
5452
continuation.resume(with: result)
@@ -65,8 +63,7 @@ import FirebaseStorage
6563
/// - Returns: StorageMetadata with additional information about the object being uploaded.
6664
func putFileAsync(from url: URL,
6765
metadata: StorageMetadata? = nil) async throws -> StorageMetadata {
68-
typealias MetadataContinuation = CheckedContinuation<StorageMetadata, Error>
69-
return try await withCheckedThrowingContinuation { (continuation: MetadataContinuation) in
66+
return try await withCheckedThrowingContinuation { continuation in
7067
// TODO: Use task to handle progress and cancellation.
7168
_ = self.putFile(from: url, metadata: metadata) { result in
7269
continuation.resume(with: result)
@@ -80,8 +77,7 @@ import FirebaseStorage
8077
/// - fileUrl: A URL representing the system file path of the object to be uploaded.
8178
/// - Returns: URL pointing to the file path of the downloaded file.
8279
func writeAsync(toFile fileURL: URL) async throws -> URL {
83-
typealias URLContinuation = CheckedContinuation<URL, Error>
84-
return try await withCheckedThrowingContinuation { (continuation: URLContinuation) in
80+
return try await withCheckedThrowingContinuation { continuation in
8581
// TODO: Use task to handle progress and cancellation.
8682
_ = self.write(toFile: fileURL) { result in
8783
continuation.resume(with: result)

0 commit comments

Comments
 (0)