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

Add @discardableResult to QueryBuilder's range and sort methods #592

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Add @discardableResult to QueryBuilder's range and sort methods #592

merged 2 commits into from
Jan 31, 2024

Conversation

jiahan-wu
Copy link
Contributor

@jiahan-wu jiahan-wu commented Jan 31, 2024

These changes are now available in 1.46.0

This Pull Request addresses an issue where calling the sort methods in the QueryBuilder class would result in a "Result of call to 'sort' is unused" warning. To resolve this, I have added the @discardableResult attribute to these methods, allowing users to call them without triggering the warning when the result is not explicitly used.

Copy link
Member

@gwynne gwynne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, nice catch!! The range methods in QueryBuilder+Range.swift also appear to be missing this attribute, could you add it to those as well?

@gwynne gwynne added enhancement New feature or request semver-minor Contains new APIs labels Jan 31, 2024
@jiahan-wu
Copy link
Contributor Author

Thanks, nice catch!! The range methods in QueryBuilder+Range.swift also appear to be missing this attribute, could you add it to those as well?

Hello, thank you for pointing that out! I've already made the modifications to the range methods in QueryBuilder+Range.swift.

@jiahan-wu jiahan-wu changed the title Add @discardableResult to QueryBuilder's sort methods Add @discardableResult to QueryBuilder's range and sort methods Jan 31, 2024
Copy link
Member

@gwynne gwynne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks again!!

@gwynne gwynne merged commit 0a2b448 into vapor:main Jan 31, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-minor Contains new APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants