Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Reimplement top level ser functions in terms of Serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 2, 2021
1 parent 59d5389 commit 4f9af33
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,13 +795,7 @@ where
W: io::Write,
T: ser::Serialize,
{
let doc = to_yaml(value)?;
let mut writer_adapter = FmtToIoWriter { writer };
YamlEmitter::new(&mut writer_adapter)
.dump(&doc)
.map_err(error::emitter)?;
writer_adapter.writer.write_all(b"\n").map_err(error::io)?;
Ok(())
value.serialize(&mut Serializer::new(writer))
}

/// Serialize the given data structure as a YAML byte vector.
Expand Down

0 comments on commit 4f9af33

Please sign in to comment.