mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-21 19:26:17 +00:00
Simplify PrettyFormatter::new
This commit is contained in:
1 parent
12cf2f0b0b
commit
e5df4b6653
1 file changed
+2
-4
+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,
|
||||
{
|
||||
/// 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,
|
||||
|
||||
Reference in new issue
Block a user