Skip to content

Add From impls for CowArray, similar to Array and ArrayView #1037

Open
@jturner314

Description

@jturner314

Discussed in #1036

Originally posted by hombit June 18, 2021
Is there any reason why CowArray doesn't implement all From which is implemented by both Array and ArrayView? My current usage is limited to build CowArray from both &Vec and Vec, but generally I'd like to write something like:

struct S<'a> {
    ca: CowArray<'a, f64, Ix1>
}

impl<'a> S<'a> {
    fn new(a: impl Into<CowArray<'a, f64, Ix1>>) -> Self {
        Self {ca: a.into()}
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions