Browse Source

discard @discardableResult change

Paul Beusterien 2 years ago
parent
commit
7eb30c2cb8

+ 0 - 3
FirebaseStorage/Sources/AsyncAwait.swift

@@ -48,7 +48,6 @@ import Foundation
     /// - Throws:
     ///   - An error if the operation failed, for example if Storage was unreachable.
     /// - Returns: StorageMetadata with additional information about the object being uploaded.
-    @discardableResult
     func putDataAsync(_ uploadData: Data,
                       metadata: StorageMetadata? = nil,
                       onProgress: ((Progress?) -> Void)? = nil) async throws -> StorageMetadata {
@@ -86,7 +85,6 @@ import Foundation
     /// - Throws:
     ///   - An error if the operation failed, for example if no file was present at the specified `url`.
     /// - Returns: `StorageMetadata` with additional information about the object being uploaded.
-    @discardableResult
     func putFileAsync(from url: URL,
                       metadata: StorageMetadata? = nil,
                       onProgress: ((Progress?) -> Void)? = nil) async throws -> StorageMetadata {
@@ -122,7 +120,6 @@ import Foundation
     ///   - An error if the operation failed, for example if Storage was unreachable
     ///   or `fileURL` did not reference a valid path on disk.
     /// - Returns: A `URL` pointing to the file path of the downloaded file.
-    @discardableResult
     func writeAsync(toFile fileURL: URL,
                     onProgress: ((Progress?) -> Void)? = nil) async throws -> URL {
       guard let onProgress else {

+ 1 - 1
FirebaseStorage/Tests/Integration/StorageAsyncAwait.swift

@@ -270,7 +270,7 @@ import XCTest
       let data = try XCTUnwrap("Hello Swift World".data(using: .utf8), "Data construction failed")
 
       Task {
-        try await ref.putDataAsync(data)
+        _ = try await ref.putDataAsync(data)
         let task = ref.write(toFile: fileURL)
 
         task.observe(StorageTaskStatus.success) { snapshot in