Skip to content

Use impl IntoIterator consistently#946

Open
logan-gatlin wants to merge 5 commits intomainfrom
logan/sql-api-cleanup
Open

Use impl IntoIterator consistently#946
logan-gatlin wants to merge 5 commits intomainfrom
logan/sql-api-cleanup

Conversation

@logan-gatlin
Copy link
Copy Markdown
Collaborator

@logan-gatlin logan-gatlin commented Mar 10, 2026

Use impl IntoIterator consistently in all APIs. This replaces two other patterns that were in use:

  • Vec<T> parameters
  • impl Into<Option<Vec<T>>>
    Using a Vec<T> parameter when only an iterable collection is an anti-pattern. Using IntoIterator instead allows users to pass arrays by value instead since the function is now generic over all array sizes (among many other types).

impl Into<Option<Vec<T>>> is also a poor practice. In every case where it was used, Some(vec![]) and None where treated the same, making the Option wrapper redundant. Since Option implements iterator, users passing None will see no change.

This change is not backwards compatible, but most users will have to make little to no change to existing code.

@logan-gatlin logan-gatlin marked this pull request as ready for review March 10, 2026 19:58
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 10, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2 untouched benchmarks


Comparing logan/sql-api-cleanup (386c504) with main (2d022ab)

Open in CodSpeed

@logan-gatlin logan-gatlin changed the title fix: Clean up SQL exec API Clean up SQL exec API Mar 10, 2026
@logan-gatlin logan-gatlin force-pushed the logan/sql-api-cleanup branch from 4de6850 to e8b2333 Compare March 11, 2026 19:56
@logan-gatlin logan-gatlin changed the title Clean up SQL exec API Use impl IntoIterator consistently Mar 11, 2026
@guybedford
Copy link
Copy Markdown
Collaborator

As a breaking change, I will leave this open to reconsider as part of a comprehensive redesign of the API rather than doing incremental breaks sporadically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants