Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@jturner314

Description

@jturner314
Issue body actions

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()}
    }
}
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.