Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

feat(Text): Add a From<Cow<str>> impl for Text #471

Merged
merged 2 commits into from May 22, 2021

Conversation

eminence
Copy link
Contributor

This is useful when you have a list of Cow<str> and you want to use it in a Row.

@fdehau
Copy link
Owner

fdehau commented May 2, 2021

Hey 👋 . Could you add a test (maybe a doc test) to make sure this case is covered going forward ?

@eminence
Copy link
Contributor Author

eminence commented May 5, 2021

Sure! I pushed a new commit that add two examples. One is in the docs for Cell, but this was kinda boring so I also added another example in the docs for Row (which happen to mirror my own personal use case):

Row::new(vec![
    Cow::Borrowed("hello"),
    Cow::Owned("world".to_uppercase()),
]);

@fdehau fdehau merged commit 24396d9 into fdehau:master May 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants