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

Unique::new now returns Option #345

Closed
crawfxrd opened this issue Jul 29, 2017 · 1 comment
Closed

Unique::new now returns Option #345

crawfxrd opened this issue Jul 29, 2017 · 1 comment

Comments

@crawfxrd
Copy link
Contributor

crawfxrd commented Jul 29, 2017

Ref: rust-lang/rust/pull/42959

Unique::new was changed to return an Option<Self>.
Unique::new_unchecked offers the same behavior as the old new.

I am up to Printing Characters. print_something does not compile using rustc 1.21.0-nightly (52a330969 2017-07-27) due to this change.

@phil-opp
Copy link
Owner

phil-opp commented Aug 2, 2017

Thanks for reporting! Yeah, we should change it to new_unchecked or maybe new().unwrap() to avoid the unsafety.

I'm on vacation until end of August, so I won't be able to fix this until then. However, I should be able to merge a pull request if someone wants to send one.

phil-opp pushed a commit that referenced this issue Aug 5, 2017
Change Unique to use `new_unchecked`. Fixes #345.
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

No branches or pull requests

2 participants