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

Introduce dedicated Text type for DeEvent::Text event #572

Merged
merged 2 commits into from
Mar 5, 2023

Conversation

Mingun
Copy link
Collaborator

@Mingun Mingun commented Mar 4, 2023

The new type would be useful in corrent implementation of #561 and #552, because introduces a place for additional data (a range of text that we should get after trim (assumed that Text would contain untrimmed text) and a span of a text)

Mingun and others added 2 commits March 4, 2023 23:05
This type would be useful when span support would be added or to implement
configurable stripping leading / trailing spaces
@Mingun Mingun added enhancement serde Issues related to mapping from Rust types to XML labels Mar 4, 2023
@Mingun Mingun requested a review from dralley March 4, 2023 18:26
@codecov-commenter
Copy link

Codecov Report

Merging #572 (098a2ea) into master (9b220f1) will decrease coverage by 0.22%.
The diff coverage is 97.97%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #572      +/-   ##
==========================================
- Coverage   64.21%   63.99%   -0.22%     
==========================================
  Files          33       33              
  Lines       16583    16517      -66     
==========================================
- Hits        10648    10570      -78     
- Misses       5935     5947      +12     
Flag Coverage Δ
unittests 63.99% <97.97%> (-0.22%) ⬇️

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

Impacted Files Coverage Δ
src/de/mod.rs 69.37% <97.93%> (-1.27%) ⬇️
src/de/simple_type.rs 93.86% <100.00%> (ø)
src/escapei.rs 13.24% <0.00%> (-0.18%) ⬇️
src/lib.rs 20.20% <0.00%> (+0.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

End(BytesEnd::new("inner")),
]
);
assert_eq!(de.write, vec![]);
assert_eq!(de.next().unwrap(), Text(Cow::Borrowed("text")));
assert_eq!(de.next().unwrap(), Text("text".into()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming we don't care whether it was borrowed or owned? (not that this aspect is being properly tested currently)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we don't care. Only the fact that Text event is generated is tested here

@Mingun Mingun merged commit 4b298fd into tafia:master Mar 5, 2023
@Mingun Mingun deleted the text-type branch March 5, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants