fix: add IntoPropValue impls for Cow<'static, str>#4051
Open
Madoshakalaka wants to merge 1 commit intomasterfrom
Open
fix: add IntoPropValue impls for Cow<'static, str>#4051Madoshakalaka wants to merge 1 commit intomasterfrom
Madoshakalaka wants to merge 1 commit intomasterfrom
Conversation
Add missing IntoPropValue conversions targeting Cow<'static, str> so that component props of that type can accept &'static str, String, and Rc<str> directly in the html! macro.
Benchmark - coreYew MasterPull Request |
|
Visit the preview URL for this PR (updated for commit 0561a55): https://yew-rs-api--pr4051-fix-cow-into-prop-va-awrzc50h.web.app (expires Fri, 13 Mar 2026 11:59:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size ComparisonDetails
✅ None of the examples has changed their size significantly. |
Benchmark - SSRYew MasterDetails
Pull RequestDetails
|
Madoshakalaka
commented
Mar 6, 2026
| = help: the following other types implement trait `IntoPropValue<T>`: | ||
| `Option<&String>` implements `IntoPropValue<Option<VNode>>` | ||
| `Option<&implicit_clone::unsync::string::IString>` implements `IntoPropValue<Option<VNode>>` | ||
| `Option<&str>` implements `IntoPropValue<Option<Cow<'_, str>>>` |
Member
Author
There was a problem hiding this comment.
the diagnostic diffs are all cosmetic
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.
Description
The dynamic tag name issue (
<@{value} />requiringCow<'static, str>) was already resolved in #3431, which switched toInto<AttrValue>.The remaining gap was that component props typed as
Cow<'static, str>could not accept common string types directly in thehtml!macro. This PR adds the missingIntoPropValueimplementations:&'static strtoCow<'static, str>(zero-cost viaCow::Borrowed)StringtoCow<'static, str>(viaCow::Owned)Rc<str>toCow<'static, str>(viaCow::Owned)fixed now.
Fixes #3524
Checklist