-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
The implementation From<&'a [T; N]>
for Cow<'a, [T]>
seems missing
#116890
Comments
The two are not compatible as Converting The difference is important when it comes to |
An There also does not currently exist an As a workaround for the code snippet in the OP, you can use use std::borrow::Cow;
fn foo<'a>(v: impl Into<Cow<'a, [i32]>>) { }
fn main() {
foo(&[1, 2, 3][..]);
} |
Should this issue be closed given that #113489 is already merged? |
Yes, thank you. |
This fails to compile
Rust playground link
With the following diagnostics:
It seems that
From<&'a [T; N]>
is not implemented forCow<'a [T]>
, whileFrom<&'a [T]>
is. Has this been an oversight, or is there a rationale behind this?Providing my own implementation does seem to work
The text was updated successfully, but these errors were encountered: