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 impl Default for SdkBody #1189

Open
Velfi opened this issue Feb 15, 2022 · 1 comment
Open

Add impl Default for SdkBody #1189

Velfi opened this issue Feb 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Velfi
Copy link
Contributor

Velfi commented Feb 15, 2022

Implement the Default trait for the SdkBody struct, preferably by having it call SdkBody::empty

@Velfi Velfi added the enhancement New feature or request label Feb 15, 2022
@rcoh
Copy link
Collaborator

rcoh commented Feb 15, 2022

so because of how SDKBody, works, default would be counter intuitive in one place, where we swap the body for taken() to record that the body ownership was moved elsewhere.

If SdkBody implemented Default, then you could use mem::take which would produce unexpected results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants