-
Notifications
You must be signed in to change notification settings - Fork 239
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 expand_empty_elements fn to Serializer #620
Add expand_empty_elements fn to Serializer #620
Conversation
Setting this to true will serialize empty elements to <element></element> instead of <element/>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add changelog entry (do not forgot to add a link target, it in the end of corresponding release section).
Other than that and a minor note about documentation looks good.
src/se/mod.rs
Outdated
/// Enable or disable expansion of empty elements. | ||
pub fn expand_empty_elements(&mut self, expand: bool) -> &mut Self { | ||
self.ser.expand_empty_elements = expand; | ||
self | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a doctest example and specify that default value is false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mingun I added a dockest and noticed changing the expand_empty_elements in the method does not affect the ContentSerializer
that actually does the serializing.
I didn't find the culprit yet, is this due to macros or cloning?
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #620 +/- ##
=======================================
Coverage 64.67% 64.68%
=======================================
Files 36 36
Lines 16998 17032 +34
=======================================
+ Hits 10994 11017 +23
- Misses 6004 6015 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! One minor note about link and everything other is good
@Mingun Ooops, I don't think this should've been merged, tests are failling. See my comment above:
|
…new serializers
Oops... I thought I saw the green OK, but forgot, that I did not wait for the tests to be completed last night. Fixed in 3ab7f64. Also strange, that GitHub did not highlight your comment for me |
Thanks for fixing it @Mingun 🙏🏻 |
Setting this to true will serialize empty elements to
<element></element>
instead of<element/>
.Fixes #617