Skip to content

Commit

Permalink
add discardable results to operations that do not require result
Browse files Browse the repository at this point in the history
  • Loading branch information
pmairoldi committed Mar 21, 2023
1 parent e392e19 commit 9f9aac4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/Charts/Data/Implementations/ChartBaseDataSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ open class ChartBaseDataSet: NSObject, ChartDataSetProtocol, NSCopying
fatalError("entryIndex(entry) is not implemented in ChartBaseDataSet")
}

open func addEntry(_ e: ChartDataEntry) -> Bool
@discardableResult open func addEntry(_ e: ChartDataEntry) -> Bool
{
fatalError("addEntry is not implemented in ChartBaseDataSet")
}

open func addEntryOrdered(_ e: ChartDataEntry) -> Bool
@discardableResult open func addEntryOrdered(_ e: ChartDataEntry) -> Bool
{
fatalError("addEntryOrdered is not implemented in ChartBaseDataSet")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ open class ChartDataSet: ChartBaseDataSet
/// - Returns: True
// TODO: This should return `Void` to follow Swift convention
@available(*, deprecated, message: "Use `append(_:)` instead", renamed: "append(_:)")
open override func addEntry(_ e: ChartDataEntry) -> Bool
@discardableResult open override func addEntry(_ e: ChartDataEntry) -> Bool
{
append(e)
return true
Expand All @@ -313,8 +313,8 @@ open class ChartDataSet: ChartBaseDataSet
/// - Parameters:
/// - e: the entry to add
/// - Returns: True
@discardableResult
open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool
// TODO: This should return `Void` to follow Swift convention
@discardableResult open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool
{
if let last = last, last.x > e.x
{
Expand Down

0 comments on commit 9f9aac4

Please sign in to comment.