clippy: address large_enum_variant and result_large_error warnings#234
Open
ekohandel wants to merge 1 commit into197g:masterfrom
Open
clippy: address large_enum_variant and result_large_error warnings#234ekohandel wants to merge 1 commit into197g:masterfrom
ekohandel wants to merge 1 commit into197g:masterfrom
Conversation
197g
reviewed
Jan 31, 2026
|
|
||
| /// Redirect to the given url | ||
| Redirect(ErrorUrl), | ||
| Redirect(Box<ErrorUrl>), |
Owner
There was a problem hiding this comment.
I don't know about the fix to the lint as applied here. If the goal is to avoid expensive moves then the number of locations where we now have (*target), which is also a kind of move in addition to the allocator, is rather high. Maybe the fields inside ErrorUrl should be smaller? The main culprit is Url hence boxing base_uri could also work. And ErrorUrl is less often destructured / moved out of.
082b221 to
98ecda2
Compare
Address these warnings by boxing the large variant that is contributing to the large size of the structure. Link: https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#large_enum_variant Link: https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#result_large_err Signed-off-by: Abe Kohandel <[email protected]>
98ecda2 to
d9551ed
Compare
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.
Address these warnings by boxing the large variant that is contributing to the large size of the structure.
This changes/fixes/improves …
I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.