Simplify PrettyFormatter::new

This commit is contained in:
Erick Tryzelaar 2015-04-26 12:05:38 -07:00
parent 12cf2f0b0b
commit e5df4b6653

View File

@ -24,7 +24,7 @@ impl<W> Serializer<W>
}
}
impl<W> Serializer<W, PrettyFormatter<'static>>
impl<'a, W> Serializer<W, PrettyFormatter<'a>>
where W: io::Write,
{
/// Creates a new JSON pretty print serializer.
@ -309,13 +309,11 @@ pub struct PrettyFormatter<'a> {
indent: &'a [u8],
}
impl PrettyFormatter<'static> {
impl<'a> PrettyFormatter<'a> {
fn new() -> Self {
PrettyFormatter::with_indent(b" ")
}
}
impl<'a> PrettyFormatter<'a> {
fn with_indent(indent: &'a [u8]) -> Self {
PrettyFormatter {
current_indent: 0,