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

Use shorter synonym for Hashmap::with_hasher(Default::default()) #1098

Merged
merged 1 commit into from Apr 11, 2017

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Apr 10, 2017

HashMap::new should have this behaviour, but has been eternally blocked by this lang feature: rust-lang/rust#27336. Specifically HashMap::new would fail to infer a hasher if it was ambiguous (most test/example code).

However we sneakily made the Default implementation generic over Hasher, so this works.


This change is Reviewable

@glennw
Copy link
Member

glennw commented Apr 10, 2017

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 45216ef has been approved by glennw

@bors-servo
Copy link
Contributor

⌛ Testing commit 45216ef with merge 99d67f7...

bors-servo pushed a commit that referenced this pull request Apr 10, 2017
Use shorter synonym for Hashmap::with_hasher(Default::default())

`HashMap::new` *should* have this behaviour, but has been eternally blocked by this lang feature: rust-lang/rust#27336. Specifically `HashMap::new` would fail to infer a hasher if it was ambiguous (most test/example code).

However we sneakily made the Default implementation generic over Hasher, so this works.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1098)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: glennw
Pushing 99d67f7 to master...

@bors-servo bors-servo merged commit 45216ef into servo:master Apr 11, 2017
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

3 participants