@@ -27,8 +27,7 @@ import FirebaseStorage
27
27
/// the task will be cancelled and an error will be thrown.
28
28
/// - Returns: Data object.
29
29
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
32
31
// TODO: Use task to handle progress and cancellation.
33
32
_ = self . getData ( maxSize: maxSize) { result in
34
33
continuation. resume ( with: result)
@@ -47,8 +46,7 @@ import FirebaseStorage
47
46
/// - Returns: StorageMetadata with additional information about the object being uploaded.
48
47
func putDataAsync( _ uploadData: Data ,
49
48
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
52
50
// TODO: Use task to handle progress and cancellation.
53
51
_ = self . putData ( uploadData, metadata: metadata) { result in
54
52
continuation. resume ( with: result)
@@ -65,8 +63,7 @@ import FirebaseStorage
65
63
/// - Returns: StorageMetadata with additional information about the object being uploaded.
66
64
func putFileAsync( from url: URL ,
67
65
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
70
67
// TODO: Use task to handle progress and cancellation.
71
68
_ = self . putFile ( from: url, metadata: metadata) { result in
72
69
continuation. resume ( with: result)
@@ -80,8 +77,7 @@ import FirebaseStorage
80
77
/// - fileUrl: A URL representing the system file path of the object to be uploaded.
81
78
/// - Returns: URL pointing to the file path of the downloaded file.
82
79
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
85
81
// TODO: Use task to handle progress and cancellation.
86
82
_ = self . write ( toFile: fileURL) { result in
87
83
continuation. resume ( with: result)
0 commit comments