Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderedSet.insert should be @discardableResult #19

Closed
fritzt0 opened this issue Apr 12, 2021 · 1 comment · Fixed by #21
Closed

OrderedSet.insert should be @discardableResult #19

fritzt0 opened this issue Apr 12, 2021 · 1 comment · Fixed by #21
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@fritzt0
Copy link

fritzt0 commented Apr 12, 2021

Often I just need to insert an element into the OrderedSet. For now I need to prefix that with '_ = ' which in my option should be avoided. Please consider adding @discardableResult to

insert(_ item: Element, at index: Index) -> (inserted: Bool, index: Index)

Best, Felix

@fritzt0 fritzt0 added the enhancement New feature or request label Apr 12, 2021
@lorentey lorentey added the good first issue Good for newcomers label Apr 12, 2021
@lorentey
Copy link
Member

Yep, this is an API oversight that we should fix.

kielgillard added a commit to kielgillard/swift-collections that referenced this issue Apr 13, 2021
lorentey pushed a commit that referenced this issue Apr 14, 2021
* Add the @discardableResult attribute to OrderedSet.insert(_:at:). Fixes #19

* Add the @discardableResult attribute to OrderedSet.updateOrAppend(_).

* Add the @discardableResult attribute to OrderedSet.updateOrInsert(_:at:).
@lorentey lorentey added this to the 0.0.3 milestone May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants