Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTake R: Read and W: Write by value #7
Comments
brson
added
the
important
label
Jun 30, 2017
This comment has been minimized.
This comment has been minimized.
|
"Interop" section. |
dtolnay
added
the
new guideline
label
Sep 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Written in eceb521. |
dtolnay
closed this
Oct 25, 2017
This comment has been minimized.
This comment has been minimized.
lfairy
commented
Nov 8, 2017
|
Can this be a Clippy lint (if it isn't already)? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dtolnay commentedApr 4, 2017
The standard library contains these two impls:
That means any function that accepts
R: ReadorW: Writeby value can be called with a mut reference if necessary.Real examples:
In the documentation of such functions, briefly remind users that a mut reference can be passed. New Rust users often struggle with this ("I want to deserialize two values from the same fs::File but I passed the file by value so I can't use it anymore").