Skip to content

Fix use of deprecated Rc:would_unwrap #68

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

Merged
merged 1 commit into from
May 14, 2017

Conversation

satoshinm
Copy link
Contributor

@satoshinm satoshinm commented May 14, 2017

Compiling with rustc 1.19.0-nightly (e17a1227a 2017-05-12) fails due to the use of Rc::would_unwrap, https://doc.rust-lang.org/std/rc/struct.Rc.html says this is deprecated in favor of strong_count, error:

error: no associated item named `would_unwrap` found for type `std::rc::Rc<_>` in the current scope
   --> src/ui/mod.rs:83:54
    |
83  |                           Element::$name(ref inner) => Rc::would_unwrap(inner),
    |                                                        ^^^^^^^^^^^^^^^^
...

I changed it to Rc:strong_count(inner) == 1, based on the comment in rust-lang/rust#27718 (comment). This fixes the error although I'm not 100% sure it is correct, unable to test since linkage fails to a different reason (#67) update: able to run steven now, but it panics, I am not sure if it is related (brand new to rust): #69

@Thinkofname
Copy link
Owner

Thanks

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.

2 participants