Skip to content

Conversation

@Mingun
Copy link
Collaborator

@Mingun Mingun commented Oct 20, 2023

This also matches behavior for elements (so we will be more consistent, see changed tests), where <a/> is always will be Some(...) because tag is present.

Fixes #671. @francisdb, FYI

…e(...)

This also matches behavior for elements, where `<a/>` is always will be Some(...) because tag is present
@Mingun Mingun added bug serde Issues related to mapping from Rust types to XML labels Oct 20, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #672 (ab8d519) into master (569ac22) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master     #672      +/-   ##
==========================================
- Coverage   65.31%   65.31%   -0.01%     
==========================================
  Files          38       38              
  Lines       17839    17837       -2     
==========================================
- Hits        11652    11650       -2     
  Misses       6187     6187              
Flag Coverage Δ
unittests 65.31% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/de/simple_type.rs 93.89% <100.00%> (-0.02%) ⬇️

@francisdb
Copy link

I guess this keeps deserializing missing optional attributes as None?

@Mingun
Copy link
Collaborator Author

Mingun commented Oct 20, 2023

Yes:

Rust Attribute Element
None missed missed
Some("") a="" <a/>
Some("a") a="a" <a>a</a>

See those tests:

mod issue252 {

@francisdb
Copy link

I see, the tricky part is in the element.

@Mingun Mingun merged commit 440e8fe into tafia:master Oct 22, 2023
@Mingun Mingun deleted the fix-671 branch October 22, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug serde Issues related to mapping from Rust types to XML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xml serde read translates optional attributes with value "" to None

3 participants