Skip to content
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

Implement Into<ArrayData> for T: Array #1979

Closed
tustvold opened this issue Jun 30, 2022 · 0 comments · Fixed by #1992
Closed

Implement Into<ArrayData> for T: Array #1979

tustvold opened this issue Jun 30, 2022 · 0 comments · Fixed by #1992
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers help wanted

Comments

@tustvold
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The array implementations are just strongly typed wrappers around an ArrayData. It therefore makes sense that the conversion can be performed cheaply. Currently the only way to do this uses Array::data and ArrayData::clone, the latter of which is not especially cheap.

Describe the solution you'd like

I would like all T: Array to impl Into<ArrayData>. Additionally these implementations should provide an into_data member function to aid in type inference.

fn into_data(self) -> ArrayData {
  self.into()
}

Describe alternatives you've considered

We could not do this, but it is fairly common to see array.data().clone() which just seems unnecessary

@tustvold tustvold added good first issue Good for newcomers enhancement Any new improvement worthy of a entry in the changelog help wanted labels Jun 30, 2022
@alamb alamb changed the title Implement Into<ArrayData> for T: Array Implement Into<ArrayData> for T: Array Jul 7, 2022
@alamb alamb added the arrow Changes to the arrow crate label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants