![]() impl `From<&[T; N]>` for `Cow<[T]>` Implement `From<&[T; N]>` for `Cow<[T]>` to simplify its usage in the following example. ```rust fn foo(data: impl Into<Cow<'static, [&'static str]>>) { /* ... */ } fn main() { foo(vec!["hello", "world"]); foo(&["hello", "world"]); // Error: the trait `From<&[&str; 2]>` is not implemented for `Cow<'static, [&'static str]>` foo(&["hello", "world"] as &[_]); // Explicit convertion into a slice is required } ``` |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |