granite-rust/library/alloc
Matthias Krüger 092ea4ba19
Rollup merge of #113489 - tguichaoua:cow_from_array, r=dtolnay
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
}
```
2024-01-26 23:15:48 +01:00
..
benches remove redundant imports 2023-12-10 10:56:22 +08:00
src Rollup merge of #113489 - tguichaoua:cow_from_array, r=dtolnay 2024-01-26 23:15:48 +01:00
tests Rollup merge of #119917 - Zalathar:split-off, r=cuviper 2024-01-26 14:43:30 +01:00
Cargo.toml Rename {collections=>alloc}{tests,benches} 2023-11-26 12:04:56 +00:00