@@ -224,7 +224,7 @@ impl Serializer {
224
224
225
225
fn is_pretty ( & self ) -> bool {
226
226
match self . pretty {
227
- Some ( ( ref config, ref pretty) ) => pretty. indent < config. depth_limit ,
227
+ Some ( ( ref config, ref pretty) ) => pretty. indent <= config. depth_limit ,
228
228
None => false ,
229
229
}
230
230
}
@@ -244,7 +244,7 @@ impl Serializer {
244
244
fn start_indent ( & mut self ) {
245
245
if let Some ( ( ref config, ref mut pretty) ) = self . pretty {
246
246
pretty. indent += 1 ;
247
- if pretty. indent < config. depth_limit {
247
+ if pretty. indent <= config. depth_limit {
248
248
let is_empty = self . is_empty . unwrap_or ( false ) ;
249
249
250
250
if !is_empty {
@@ -256,7 +256,7 @@ impl Serializer {
256
256
257
257
fn indent ( & mut self ) {
258
258
if let Some ( ( ref config, ref pretty) ) = self . pretty {
259
- if pretty. indent < config. depth_limit {
259
+ if pretty. indent <= config. depth_limit {
260
260
self . output
261
261
. extend ( ( 0 ..pretty. indent ) . map ( |_| config. indentor . as_str ( ) ) ) ;
262
262
}
@@ -265,7 +265,7 @@ impl Serializer {
265
265
266
266
fn end_indent ( & mut self ) {
267
267
if let Some ( ( ref config, ref mut pretty) ) = self . pretty {
268
- if pretty. indent < config. depth_limit {
268
+ if pretty. indent <= config. depth_limit {
269
269
let is_empty = self . is_empty . unwrap_or ( false ) ;
270
270
271
271
if !is_empty {
@@ -567,7 +567,7 @@ impl<'a> ser::SerializeSeq for &'a mut Serializer {
567
567
self . output += "," ;
568
568
569
569
if let Some ( ( ref config, ref mut pretty) ) = self . pretty {
570
- if pretty. indent < config. depth_limit {
570
+ if pretty. indent <= config. depth_limit {
571
571
if config. enumerate_arrays {
572
572
assert ! ( config. new_line. contains( '\n' ) ) ;
573
573
let index = pretty. sequence_index . last_mut ( ) . unwrap ( ) ;
@@ -611,7 +611,7 @@ impl<'a> ser::SerializeTuple for &'a mut Serializer {
611
611
self . output += "," ;
612
612
613
613
if let Some ( ( ref config, ref pretty) ) = self . pretty {
614
- if pretty. indent < config. depth_limit {
614
+ if pretty. indent <= config. depth_limit {
615
615
self . output += if self . separate_tuple_members ( ) {
616
616
& config. new_line
617
617
} else {
@@ -697,7 +697,7 @@ impl<'a> ser::SerializeMap for &'a mut Serializer {
697
697
self . output += "," ;
698
698
699
699
if let Some ( ( ref config, ref pretty) ) = self . pretty {
700
- if pretty. indent < config. depth_limit {
700
+ if pretty. indent <= config. depth_limit {
701
701
self . output += & config. new_line ;
702
702
}
703
703
}
@@ -734,7 +734,7 @@ impl<'a> ser::SerializeStruct for &'a mut Serializer {
734
734
self . output += "," ;
735
735
736
736
if let Some ( ( ref config, ref pretty) ) = self . pretty {
737
- if pretty. indent < config. depth_limit {
737
+ if pretty. indent <= config. depth_limit {
738
738
self . output += & config. new_line ;
739
739
}
740
740
}
0 commit comments