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

Commit

Permalink
Export Serializer from crate root
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 2, 2021
1 parent 4f9af33 commit fd828cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

pub use crate::de::{from_reader, from_slice, from_str, Deserializer};
pub use crate::error::{Error, Location, Result};
pub use crate::ser::{to_string, to_vec, to_writer};
pub use crate::ser::{to_string, to_vec, to_writer, Serializer};
pub use crate::value::{from_value, to_value, Index, Number, Sequence, Value};

#[doc(inline)]
Expand Down
3 changes: 3 additions & 0 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde::{ser, serde_if_integer128};
use std::{fmt, io, num, str};
use yaml_rust::{yaml, Yaml, YamlEmitter};

/// A structure for serializing Rust values into YAML.
pub struct Serializer<W> {
writer: W,
}
Expand All @@ -15,10 +16,12 @@ impl<W> Serializer<W>
where
W: io::Write,
{
/// Creates a new YAML serializer.
pub fn new(writer: W) -> Self {
Serializer { writer }
}

/// Unwrap the underlying `io::Write` object from the `Serializer`.
pub fn into_inner(self) -> W {
self.writer
}
Expand Down

0 comments on commit fd828cb

Please sign in to comment.