You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for the crate!
This PR adds Encode/Decode support for smol_str::SmolStr behind an optional smol_str feature flag, following the same pattern as the existing uuid, time, and rust_decimal integrations.
For efficiency, bitcode checks UTF-8 of multiple strings at once during decoding and vectorizes during encoding. However, this requires using a more specialized pattern than DerefEncoder and FromDecoder. The following snippets can be adapted for SmolStr. Please make an impl_string macro that can be used to support anything with the API of String, and use it for String and SmolStr. You will have to use <T>::from(&str) instead of <str>::to_owned(&self).
Hi, @finnbear! Thank you for the comments.
Could you please check out the update? I hope I understood everything correctly.
I've encountered a problem with MSRV - smol_str 0.3.4+ uses edition 2024 and requires Rust 1.89, while bitcode's MSRV is 1.70. The only non-yanked version compatible with 1.70 is 0.3.2. Pinning to a single old version isn't a great solution. Do you have any plans to bump the MSRV to 1.89 or higher? Asking just in case :)
Thanks, looks good. Next time I work on bitcode (could be weeks/months from now), I'll fully review and likely merge this, making any remaining edits myself.
Regarding MSRV, this seems like a non-issue because:
it's an optional dependency
we can say version="0.3.2" which is not the same as pinning (version="=0.3.2"), and is fully compatible with "0.3.4+"
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
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.
Hi, thank you for the crate!
This PR adds
Encode/Decodesupport forsmol_str::SmolStrbehind an optional smol_str feature flag, following the same pattern as the existing uuid, time, and rust_decimal integrations.