apple / swift-algorithms

Commonly used sequence and collection algorithms for Swift
Apache License 2.0
5.9k stars 435 forks source link

Consider using @discardableResult where possible. #187

Closed kennycarruthers closed 2 years ago

kennycarruthers commented 2 years ago

Some of the algorithms in this package have a return value that might not be needed by the caller. It would be nice if these were marked as @ discardableResult so that callers don't have to use _ = to silence Xcode warnings.

For example, stablePartition returns the start of the resulting suffix, which might not be of interest to a caller who's only interested in the final result.

mdznr commented 2 years ago

https://github.com/apple/swift-algorithms/issues/67

kennycarruthers commented 2 years ago

Oops, sorry. Not sure how I missed that obvious duplicate! Feel free to close this issue.