Skip to content

Commit

Permalink
Merge pull request tafia#820 from Mingun/fix-indents
Browse files Browse the repository at this point in the history
Do not write excess indents arount text fields when serialize with serde
  • Loading branch information
Mingun authored Oct 18, 2024
2 parents 6eea6bb + da88af2 commit aad62ba
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 376 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

### Bug Fixes

- [#655]: Do not write indent before and after `$text` fields and those `$value` fields
that are serialized as a text (for example, `usize` or `String`).

### Misc Changes

- [#227]: Split `SeError` from `DeError` in the `serialize` feature.
Expand All @@ -26,10 +29,13 @@
- [#811]: Renamed `Error::EscapeError` to `Error::Escape` to match other variants.
- [#811]: Narrow down error return type from `Error` where only one variant is ever returned:
attribute related methods on `BytesStart` and `BytesDecl` returns `AttrError`
- [#820]: Classify output of the `Serializer` by returning an enumeration with kind of written data

[#227]: https://github.com/tafia/quick-xml/issues/227
[#655]: https://github.com/tafia/quick-xml/issues/655
[#810]: https://github.com/tafia/quick-xml/pull/810
[#811]: https://github.com/tafia/quick-xml/pull/811
[#820]: https://github.com/tafia/quick-xml/pull/820


## 0.36.2 -- 2024-09-20
Expand Down
5 changes: 2 additions & 3 deletions src/de/simple_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ impl<'de, 'a> EnumAccess<'de> for SimpleTypeDeserializer<'de, 'a> {
mod tests {
use super::*;
use crate::se::simple_type::{QuoteTarget, SimpleTypeSerializer};
use crate::se::{Indent, QuoteLevel};
use crate::se::QuoteLevel;
use crate::utils::{ByteBuf, Bytes};
use serde::de::IgnoredAny;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -828,7 +828,6 @@ mod tests {
writer: String::new(),
target: QuoteTarget::Text,
level: QuoteLevel::Full,
indent: Indent::None,
})
.unwrap(),
xml
Expand Down Expand Up @@ -943,7 +942,7 @@ mod tests {
writer: &mut buffer,
target: QuoteTarget::Text,
level: QuoteLevel::Full,
indent: Some(Indent::None),
write_delimiter: false,
})
.unwrap();
assert_eq!(buffer, $input);
Expand Down
Loading

0 comments on commit aad62ba

Please sign in to comment.