This came up in discussion over at Twitch API Discord
currently, it can be hard to reason how to deal with a method like
fn(Self, impl Into<Cow<'a, [&'a Borrowed]>>)
we have a bunch of these after #280
One way to deal with this, given we have a Vec<String>, is
fn builder(s: impl Into<Cow<'a, [&'a Borrowed]>>) -> Foo {
todo!()
}
fn bar(items: Vec<String>) {
let items: Vec<&Borrowed> = items.iter().map(Into::into).collect();
builder(items)
}
but coming up with this is not apparent.
This is related to #114 (comment) where we would make the allocation optional
This came up in discussion over at Twitch API Discord
currently, it can be hard to reason how to deal with a method like
we have a bunch of these after #280
One way to deal with this, given we have a
Vec<String>, isbut coming up with this is not apparent.
This is related to #114 (comment) where we would make the allocation optional