Skip to content

Commit 7aed839

Browse files
bors[bot]Plecra
andauthored
Merge #206
206: feat: port `ser::Serializer` to `io::Write` r=kvark a=Plecra Makes the `Serializer` struct generic over `io::Write`, allowing it to be used with more types (and less allocation). As a side-effect, the trailing commas are also removed from the output. This was a quick implementation, written in response to compiler messages, so it could probably do with some cleaning up. It might be a good time to approach #175 Closes #202 ## TODO - [ ] Update docs Co-authored-by: Marli Frost <[email protected]>
2 parents 92c1d5d + 5b42d62 commit 7aed839

9 files changed

+383
-216
lines changed

src/de/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ pub use crate::parse::Position;
55
use serde::de::{self, DeserializeSeed, Deserializer as SerdeError, Visitor};
66
use std::{borrow::Cow, io, str};
77

8-
use self::id::IdDeserializer;
9-
use self::tag::TagDeserializer;
10-
use crate::extensions::Extensions;
11-
use crate::parse::{AnyNum, Bytes, ParsedStr};
8+
use self::{id::IdDeserializer, tag::TagDeserializer};
9+
use crate::{
10+
extensions::Extensions,
11+
parse::{AnyNum, Bytes, ParsedStr},
12+
};
1213

1314
mod error;
1415
mod id;

src/parse.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use std::{
44
str::{from_utf8, from_utf8_unchecked, FromStr},
55
};
66

7-
use crate::de::{Error, ParseError, Result};
8-
use crate::extensions::Extensions;
7+
use crate::{
8+
de::{Error, ParseError, Result},
9+
extensions::Extensions,
10+
};
911

1012
const DIGITS: &[u8] = b"0123456789ABCDEFabcdef_";
1113
const FLOAT_CHARS: &[u8] = b"0123456789.+-eE";

0 commit comments

Comments
 (0)