Skip to content

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