mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
🛡 Rephrase as guard statements
This commit is contained in:
parent
6a12b3096f
commit
a85d4e8595
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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!
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue