mirror of
https://github.com/mas-cli/mas
synced 2025-02-16 12:38:30 +00:00
🧹 Avoid force casts
This commit is contained in:
parent
af944e8caf
commit
bf093082e8
2 changed files with 2 additions and 6 deletions
|
@ -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(())
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue