Solve low hanging fruit causing large future sizes#3357
Merged
GnomedDev merged 1 commit intoserenity-rs:nextfrom May 19, 2025
Merged
Solve low hanging fruit causing large future sizes#3357GnomedDev merged 1 commit intoserenity-rs:nextfrom
GnomedDev merged 1 commit intoserenity-rs:nextfrom
Conversation
e02aa2b to
5b9ea80
Compare
mkrasnitski
reviewed
Apr 28, 2025
Comment on lines
+78
to
+84
| // Build the multipart first, as to keep future size small. | ||
| let multipart = if let Some(multipart) = self.multipart { | ||
| Some(multipart.build_form().await?) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
Collaborator
There was a problem hiding this comment.
I'm confused here. The function call doesn't capture any locals, so why would it matter when it gets awaited? Or does it capture all of self?
Member
Author
There was a problem hiding this comment.
The function call doesn't use any of the locals, but the state machine for Request::build still needs to store the locals. By moving this back, we don't have to store the path/builder/headers in the state machine as there are no awaits after this.
5b9ea80 to
4ebbd4b
Compare
arqunis
approved these changes
May 19, 2025
GnomedDev
added a commit
that referenced
this pull request
May 19, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 30, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 30, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 30, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Jul 28, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Jul 28, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 7, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 7, 2025
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 7, 2025
arqunis
pushed a commit
to arqunis/serenity
that referenced
this pull request
Jan 22, 2026
arqunis
pushed a commit
to arqunis/serenity
that referenced
this pull request
Feb 27, 2026
arqunis
pushed a commit
to arqunis/serenity
that referenced
this pull request
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #3356.
This PR also removes
CreateMessage::reactionsas this brought my attention to it and it is bloating future sizes for all users while not following discord's API.