From c112c901d598b803115e22ba8e46ccb03637d606 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Thu, 24 Oct 2024 08:22:32 -0700 Subject: [PATCH] Updated changelog --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ src/ser.rs | 9 ++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3cba94b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + + +## Unreleased + +### Breaking CHanges + +- `parser::Config::allow_implicit_map` has been renamed to + `allow_implicit_map_at_root`. +- These types are now marked as `#[non_exhaustive]`: + - `parser::Config` + - `ser::Config` + - `writer::Config` + +### Fixes + +- Raw strings and byte strings without any `#`s can now be used. E.g., `r"\"` +- Implicit map support now supports serializing and deserializing any map-like + type. + +### Added + +- When the new flag `ser::Config::anonymous_structs` is enabled, structures will + be written without their name. + + +## v0.1.0 + +Initial release. \ No newline at end of file diff --git a/src/ser.rs b/src/ser.rs index 6946e68..187481b 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -242,7 +242,6 @@ where Ok(self) } - // TODO implicit_map_at_root fn serialize_map(self, _len: Option) -> Result { let is_implicit_map = self.implicit_map_at_root; self.mark_value_seen(); @@ -465,8 +464,12 @@ pub struct Config { } impl Config { - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self { + writer: writer::Config::Compact, + implicit_map_at_root: false, + anonymous_structs: false, + } } pub fn pretty() -> Self {