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

Add try_into, borrowed_into, and borrowed_try_into attributes #2511

Closed
wants to merge 2 commits into from

Conversation

oblique
Copy link

@oblique oblique commented Jul 15, 2023

For the borrowed_* the user needs to implement impl<'a> Into<IntoType> for &'a Type. With this the cloing of the value will not happen.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

An equivalent attribute was proposed in the past in #1833, and I would prefer not to add it.

@dtolnay dtolnay closed this Jul 15, 2023
@oblique
Copy link
Author

oblique commented Jul 15, 2023

@dtolnay what about try_into? I can cherry-pick that in another PR

@dtolnay
Copy link
Member

dtolnay commented Jul 15, 2023

I feel the same about all of them — handwritten Serialize impl is fine for these situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants