From e5df4b6653ddfa558b5ba56d58c274e2e626fc24 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 26 Apr 2015 12:05:38 -0700 Subject: [PATCH] Simplify PrettyFormatter::new --- src/json/ser.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/json/ser.rs b/src/json/ser.rs index 10e7a1fc..a6fc2070 100644 --- a/src/json/ser.rs +++ b/src/json/ser.rs @@ -24,7 +24,7 @@ impl Serializer } } -impl Serializer> +impl<'a, W> Serializer> 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,