🧹 Avoid force casts

This commit is contained in:
Chris Araman 2021-03-22 15:13:48 -07:00
parent af944e8caf
commit bf093082e8
No known key found for this signature in database
GPG key ID: BB4499D9E11B61E0
2 changed files with 2 additions and 6 deletions

View file

@ -52,9 +52,7 @@ public struct OutdatedCommand: CommandProtocol {
}
} catch {
// Bubble up MASErrors
// swiftlint:disable force_cast
return .failure(error is MASError ? error as! MASError : .searchFailed)
// swiftlint:enable force_cast
return .failure(error as? MASError ?? .searchFailed)
}
}
return .success(())

View file

@ -88,9 +88,7 @@ public struct UpgradeCommand: CommandProtocol {
}
} catch {
// Bubble up MASErrors
// swiftlint:disable force_cast
return .failure(error is MASError ? error as! MASError : .searchFailed)
// swiftlint:enable force_cast
return .failure(error as? MASError ?? .searchFailed)
}
}
}