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

Define the IntoIterator traits on the CS types #1

Merged
merged 2 commits into from
Jun 4, 2022
Merged

Define the IntoIterator traits on the CS types #1

merged 2 commits into from
Jun 4, 2022

Conversation

Kerollmops
Copy link
Contributor

I found it useful to declare the IntoIterator trait on these two CS types, I no more need to call .into_inner().into_iter() and can pass this CS type to any function accepting an IntoIterator<Item = T> instead of converting it.

However, the array implementation of IntoIterator that returned owned types is quite recent and has been released in the 1.53 version of Rust, I don't know if we want to bump the MSRV of this crate and if we don't: how can we make it conditional to the version of Rust the user is using.

@naughie
Copy link
Owner

naughie commented Jun 4, 2022

Thanks for the useful implementation!

edition = "2021" is specified in Cargo.toml, so I think a user who uses rustc < 1.56.0 cannot compile, regardless the existence of array::IntoIter.

@naughie naughie merged commit 947e494 into naughie:main Jun 4, 2022
@Kerollmops Kerollmops deleted the define-more-impls branch June 6, 2022 08:19
bors bot added a commit to meilisearch/meilisearch that referenced this pull request Jun 6, 2022
2464: Simplify the `star_or` function usage r=ManyTheFish a=Kerollmops

This PR simplifies the usage of the `star_or` function that was originally introduced in #2399. The `serde-cs` naughie/serde-cs#1 PR was merged and was implementing the `IntoIterator` trait on the `CS` types, which makes it possible to directly collect without converting a `CS` into the inner type (vec).

Co-authored-by: Kerollmops <clement@meilisearch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants