fix: retain not set len if predicate panics#413
Merged
ParkMyCar merged 2 commits intoParkMyCar:mainfrom Dec 29, 2024
ryota2357:fix-retain
Merged
fix: retain not set len if predicate panics#413ParkMyCar merged 2 commits intoParkMyCar:mainfrom ryota2357:fix-retain
ParkMyCar merged 2 commits intoParkMyCar:mainfrom
ryota2357:fix-retain
Conversation
Contributor
Author
|
CI using nightly rust failed because of
I couldn't understand why 'Fuzz' and 'example - diesel' failed. |
Contributor
Author
|
I added |
Owner
|
This is fantastic @ryota2357, thank you for the fix! Apologies for the various clippy and test changes you had to make, I just merged #414 and #415 that separately fixed these issues so I removed the last three commits from this PR. I also appreciate how you made those changes in separate commits, made it super easy to revert! I plan to release a |
ParkMyCar
pushed a commit
that referenced
this pull request
Dec 29, 2024
* test: add retain method test from alloc::String https://github.com/rust-lang/rust/blob/73c278fd936c8eab4c8c6c6cb638da091b1e6740/library/alloc/tests/string.rs#L466-L499 * fix: retain not set len if predicate panics
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.
The current implementation of
CompactString::retainbreakslenif thepredicatepassed asretainmethod argument panics during iteration.Please see: rust-lang/rust#78498
For this problem, I did:
alloc::Stringhave.retainmethod implementation.