Follow

std::borrow::Cow is a very useful way to provide a value that can be copied on demand _for types that can be cloned_. In many cases it would make sense to:
- for cloneable types accept Cow<T>,
- for other types accept T.

We could make this work with Cow<B>, using a very weird construct (have B be essentially equivalent to Infeasible, but implement ToOwned with Owned = the_type_we_want). Is there a less cumbersome way?

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.