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

fix: omit empty requests #1706

Merged
merged 3 commits into from
Nov 29, 2024
Merged

fix: omit empty requests #1706

merged 3 commits into from
Nov 29, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Nov 29, 2024

Motivation

We can do this here to avoid additional checks on callsite

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines +45 to 50
let mut request = request.into_iter().peekable();
// Omit empty requests.
if request.peek().is_none() {
return;
}
self.0.push(core::iter::once(request_type).chain(request).collect());
Copy link
Member

Choose a reason for hiding this comment

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

ah this is an optimized self.push_request(core::iter::once(request_type).chain(request).collect())

@mattsse mattsse enabled auto-merge (squash) November 29, 2024 15:03
@mattsse mattsse merged commit 20d13fa into main Nov 29, 2024
26 checks passed
@mattsse mattsse deleted the klkvr/requests-fix branch November 29, 2024 15:04
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