Skip to content

Commit

Permalink
🧹 Avoid force casts
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-araman committed Mar 28, 2021
1 parent af944e8 commit bf09308
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions MasKit/Commands/Outdated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
4 changes: 1 addition & 3 deletions MasKit/Commands/Upgrade.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit bf09308

Please sign in to comment.