-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add FromIntoRef and TryFromIntoRef #618
Conversation
Codecov Report
@@ Coverage Diff @@
## master #618 +/- ##
==========================================
+ Coverage 63.63% 64.22% +0.58%
==========================================
Files 35 36 +1
Lines 2090 2127 +37
==========================================
+ Hits 1330 1366 +36
- Misses 760 761 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks for the contribution. I think I see the utility. Can you please confirm: the new types are almost identical to However, the “borrow” name part seems wrong here. In the serde ecosystem, borrow usually refers to borrowing during deserialization. The new types do not enable borrowing during serialization either, they only remove the |
Yes I confirm the above.
I'm working on a WASM project that has many serializations of data that resides in heap and I wanted to minimize cloning whenever I can.
I agree
|
Thanks for the info. I like |
94b0b7f
to
babfaeb
Compare
I changed the names. I also changed the first line of the doc comments. Let me know if you prefer other wording there. |
Thank you for the changes. This looks good now. bors r+ |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Conversions from references are rare, however a user who controls the implementation of the type, can implement
Into<T> from &'a MyType
and use this to avoid cloning.