mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 07:21:03 +00:00
Simplify PrettyFormatter::new
This commit is contained in:
+2
-4
@@ -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,
|
where W: io::Write,
|
||||||
{
|
{
|
||||||
/// Creates a new JSON pretty print serializer.
|
/// Creates a new JSON pretty print serializer.
|
||||||
@@ -309,13 +309,11 @@ pub struct PrettyFormatter<'a> {
|
|||||||
indent: &'a [u8],
|
indent: &'a [u8],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PrettyFormatter<'static> {
|
impl<'a> PrettyFormatter<'a> {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
PrettyFormatter::with_indent(b" ")
|
PrettyFormatter::with_indent(b" ")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> PrettyFormatter<'a> {
|
|
||||||
fn with_indent(indent: &'a [u8]) -> Self {
|
fn with_indent(indent: &'a [u8]) -> Self {
|
||||||
PrettyFormatter {
|
PrettyFormatter {
|
||||||
current_indent: 0,
|
current_indent: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user