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

clone redundant? #23

Closed
benma opened this issue Jun 18, 2020 · 2 comments
Closed

clone redundant? #23

benma opened this issue Jun 18, 2020 · 2 comments

Comments

@benma
Copy link

benma commented Jun 18, 2020

Running clippy warns that this clone is redundant:

mem::forget(arc.clone());

True or false?

Thanks

@ghost
Copy link

ghost commented Jun 18, 2020

No, this clone and forget is necessary to bump the reference counter. This won't be necessary anymore when this feature gets stabilized: rust-lang/rust#70733

benma added a commit to benma/bitbox02-firmware that referenced this issue Jun 19, 2020
Has false positives that can be very subtle, so best to play it
safe.

async-rs/async-task#23
@benma
Copy link
Author

benma commented Jun 19, 2020

Thanks!

@benma benma closed this as completed Jun 19, 2020
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

1 participant