Closed
Description
Currently we have impl From<&[T]> for Vec<T> where T: Clone
and impl From<&mut [T]> for Vec<T> where T: Clone
, should From<&[T; N]>
and From<&mut [T; N]>
also be implemented for Vec<T>
where T: Clone
?
Currently we have impl From<&[T]> for Vec<T> where T: Clone
and impl From<&mut [T]> for Vec<T> where T: Clone
, should From<&[T; N]>
and From<&mut [T; N]>
also be implemented for Vec<T>
where T: Clone
?
Activity
vincenzopalazzo commentedon Aug 22, 2022
@rustbot claim
vincenzopalazzo commentedon Oct 22, 2022
Can you help me with runnable code to understand why the
From<&mut [T; N]> [for Vec<T> where T: Clone
will be useful and what can be a use case for it?@rustbot label +T-libs-api
vincenzopalazzo commentedon Oct 22, 2022
Ah ok, maybe I understand what do you mean, currently we can do
And your proposal is to support
EFanZh commentedon Oct 24, 2022
@vincenzopalazzo I don’t have a use case for
From<&mut [T; N]>
, adding it is just for matching existingFrom<&mut [T]>
. But forFrom<&[T; N]>
, I want to be able to write:instead of
From<{&,&mut} [T; N]>
forVec<T>
whereT: Clone
#111278Auto merge of rust-lang#111278 - EFanZh:implement-from-array-refs-for…