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

bug in SingularField<T>::unwrap_or_default code? #572

Closed
aramd opened this issue Sep 24, 2021 · 1 comment
Closed

bug in SingularField<T>::unwrap_or_default code? #572

aramd opened this issue Sep 24, 2021 · 1 comment

Comments

@aramd
Copy link

aramd commented Sep 24, 2021

It seems there is a bug in SingularField<T>::unwrap_or_default implementation: https://github.com/stepancheg/rust-protobuf/blob/v2.25.1/protobuf/src/singular.rs#L343.
It is not clear why should unwrap_or_default call self.value.clear().

As an example for ::protobuf::SingularField<::std::string::String> type unwrap_or_default always returns empty string.

stepancheg added a commit that referenced this issue Oct 24, 2021
@stepancheg
Copy link
Owner

Thanks!

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

No branches or pull requests

2 participants