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

Simplified ch16-02 transmitter cloning #949

Closed
wants to merge 1 commit into from

Conversation

jalexvig
Copy link
Contributor

@jalexvig jalexvig commented Oct 4, 2017

No description provided.

Changed from static function call to method call for clarity.
@carols10cents
Copy link
Member

This was purposeful, actually. Because mspc::Sender's implementation of Clone isn't actually doing a copy of data (it performs actions similar to increasing a reference count), this call to clone is inexpensive in comparison to most calls to clone. By choosing to call clone using expanded syntax, we can communicate to the reader of the code that this clone is not doing potentially-unnecessary allocations.

This is a fairly new Rust style, but one we've chosen to use throughout the book.

Thank you for the PR though!

@jalexvig
Copy link
Contributor Author

jalexvig commented Oct 4, 2017

Thanks for the intel Carol! Really appreciate the work you and Steve put into this book.

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