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

Add IndexMap::from(array) and IndexSet::from(array) #205

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

rouge8
Copy link
Contributor

@rouge8 rouge8 commented Oct 21, 2021

This patch adds IndexMap::from(array) and IndexSet::from(array) to match the API for HashMap, HashSet, etc. as of rust-lang/rust#84111.

@rouge8
Copy link
Contributor Author

rouge8 commented Oct 24, 2021

I think the CI failure is because of the MSRV… I’m not sure how to handle that. 😕

@bluss
Copy link
Member

bluss commented Oct 24, 2021

Yes, that's expected. We should pick this up as soon as we can. Unsure if using autocfg is a good solution here.

@rouge8
Copy link
Contributor Author

rouge8 commented Oct 24, 2021

@bluss I think I figured out how to use autocfg for this. 🤞

@rouge8
Copy link
Contributor Author

rouge8 commented Dec 2, 2021

@bluss bumping this now that CI is passing

build.rs Show resolved Hide resolved
src/map.rs Show resolved Hide resolved
Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some cleanup on the cfgs.

src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/set.rs Outdated Show resolved Hide resolved
src/set.rs Outdated Show resolved Hide resolved
@rouge8 rouge8 requested a review from cuviper January 6, 2022 18:24
@rouge8
Copy link
Contributor Author

rouge8 commented Jan 6, 2022

Just some cleanup on the cfgs.

Oops, good catch. Fixed!

This patch adds `IndexMap::from(array)` and `IndexSet::from(array)` to
match the API for `HashMap`, `HashSet`, etc. as of
rust-lang/rust#84111.
@cuviper
Copy link
Member

cuviper commented Jan 6, 2022

Oh, we do still need std because of RandomState -- that's too bad.

@rouge8
Copy link
Contributor Author

rouge8 commented Jan 6, 2022

Oh, we do still need std because of RandomState -- that's too bad.

Ah okay. Reverted removing has_std.

Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cuviper cuviper merged commit 8bb46ca into indexmap-rs:master Jan 6, 2022
@rouge8 rouge8 deleted the from-array branch January 6, 2022 18:41
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.

3 participants