File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,37 +44,45 @@ impl<'a> Formatter<'a> {
44
44
indent : 0 ,
45
45
}
46
46
}
47
+
47
48
pub fn indent ( & mut self ) {
48
49
for _ in 0 ..self . indent {
49
50
self . buf . push ( ' ' ) ;
50
51
}
51
52
}
53
+
52
54
pub fn endline ( & mut self ) {
53
55
self . buf . push ( '\n' ) ;
54
56
}
57
+
55
58
pub fn start_block ( & mut self ) {
56
59
self . buf . push ( '{' ) ;
57
60
self . endline ( ) ;
58
61
self . indent += self . style . indent ;
59
62
}
63
+
60
64
pub fn end_block ( & mut self ) {
61
65
self . indent = self . indent . checked_sub ( self . style . indent )
62
66
. expect ( "negative indent" ) ;
63
67
self . indent ( ) ;
64
68
self . buf . push ( '}' ) ;
65
69
self . endline ( ) ;
66
70
}
71
+
67
72
pub fn margin ( & mut self ) {
68
73
if !self . buf . is_empty ( ) {
69
74
self . buf . push ( '\n' ) ;
70
75
}
71
76
}
77
+
72
78
pub fn write ( & mut self , s : & str ) {
73
79
self . buf . push_str ( s) ;
74
80
}
81
+
75
82
pub fn into_string ( self ) -> String {
76
83
self . buf
77
84
}
85
+
78
86
pub fn write_quoted ( & mut self , s : & str ) {
79
87
let mut has_newline = false ;
80
88
let mut has_nonprintable = false ;
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ impl<'a> Parser for Value<'a> {
89
89
c. kind == self . kind && c. value == self . value
90
90
} ) . parse_lazy ( input)
91
91
}
92
+
92
93
fn add_error ( & mut self ,
93
94
error : & mut Tracked < <Self :: Input as StreamOnce >:: Error > )
94
95
{
You can’t perform that action at this time.
0 commit comments