Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Value for Cow<T> where T: Value #3146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loewenheim
Copy link

This implements Value for Cow<'a, T> where T: Value.

Motivation

This is one part of #726. I also recently ran into this personally when trying to record a field of type Option<Cow<str>>.

Copy link
Contributor

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be unit tested reasonably?

@loewenheim
Copy link
Author

Can this be unit tested reasonably?

I could adapt a test like this one to use Cow, would that be sufficient?

@joshka
Copy link
Contributor

joshka commented Feb 10, 2025

I could adapt a test like this one to use Cow, would that be sufficient?

Yeah, probably. It's likely no big deal, as this code is super simple. But a unit test here helps clarify the behavior and catches any future regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants