🛡 Rephrase as guard statements

This commit is contained in:
Chris Araman 2021-04-21 22:34:09 -07:00
parent 6a12b3096f
commit a85d4e8595
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0
2 changed files with 6 additions and 6 deletions

View file

@ -40,7 +40,7 @@ public struct OutdatedCommand: CommandProtocol {
storeSearch.lookup(app: installedApp.itemIdentifier.intValue) { storeApp, error in
defer { group.leave() }
if let error = error {
guard error == nil else {
// Bubble up MASErrors
failure = error as? MASError ?? .searchFailed
return

View file

@ -51,14 +51,14 @@ class NetworkManager {
group.wait()
if let error = error {
throw error
guard error == nil else {
throw error!
}
if let data = data {
return data
guard data != nil else {
throw MASError.noData
}
throw MASError.noData
return data!
}
}