Skip to content

Commit c4a1eb4

Browse files
committed
Do not trim spaces in events using Reader capabilities
fixed: de::tests::merge_text::comment_between::text_and_empty_cdata de::tests::merge_text::pi_between::text_and_empty_cdata de::tests::merge_text::text_and_empty_cdata
1 parent 4a96285 commit c4a1eb4

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/de/mod.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,10 +2500,7 @@ impl<'de> Deserializer<'de, SliceReader<'de>> {
25002500
#[allow(clippy::should_implement_trait)]
25012501
pub fn from_str(s: &'de str) -> Self {
25022502
let mut reader = Reader::from_str(s);
2503-
reader
2504-
.expand_empty_elements(true)
2505-
.check_end_names(true)
2506-
.trim_text(true);
2503+
reader.expand_empty_elements(true).check_end_names(true);
25072504
Self::new(SliceReader {
25082505
reader,
25092506
start_trimmer: StartTrimmer::default(),
@@ -2521,10 +2518,7 @@ where
25212518
/// is known to represent UTF-8, you can decode it first before using [`from_str`].
25222519
pub fn from_reader(reader: R) -> Self {
25232520
let mut reader = Reader::from_reader(reader);
2524-
reader
2525-
.expand_empty_elements(true)
2526-
.check_end_names(true)
2527-
.trim_text(true);
2521+
reader.expand_empty_elements(true).check_end_names(true);
25282522

25292523
Self::new(IoReader {
25302524
reader,
@@ -3420,7 +3414,6 @@ mod tests {
34203414

34213415
reader
34223416
.reader
3423-
.trim_text(true)
34243417
.expand_empty_elements(true)
34253418
.check_end_names(true);
34263419

0 commit comments

Comments
 (0)