Is there a reason why some methods take ownership instead of just borrowing? #3007
izagawd
started this conversation in
Show and tell
Replies: 1 comment 5 replies
-
Because the From trait consumes the value, it does not provide an implementation that takes by reference. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
for example
i know that u can just clone the User, but,
the User struct has a decent chunk of data, so thats a decent chunk of data to clone
is there a reason for it to pass ownerships instead of borrowing?
Beta Was this translation helpful? Give feedback.
All reactions