-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
It might be nice to have a Cow
type in heapless.
pub enum Cow<'a, B, const N>
where
B: ToOwned,
{
Borrowed(&'a B),
Owned(<B as ToOwned>::Owned<N>),
}
Example
let string = heapless::Cow<'static, str, 8>;
let vec = heapless::Cow<'a, [u8], 16>;
But I'm not sure if this is actually a good idea because you have to allocate the entire Owned
object anyway.
Metadata
Metadata
Assignees
Labels
No labels