Skip to content

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

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

Open
jturner314 opened this issue Jun 18, 2021 Discussed in #1036 · 1 comment
Open

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

jturner314 opened this issue Jun 18, 2021 Discussed in #1036 · 1 comment

Comments

@jturner314
Copy link
Member

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()}
    }
}
@jturner314
Copy link
Member Author

Two PRs will resolve this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant