Skip to content

Commit eda4924

Browse files
author
Vincent Prouillet
committed
Let fns breath a bit
1 parent 375270c commit eda4924

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/format.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,45 @@ impl<'a> Formatter<'a> {
4444
indent: 0,
4545
}
4646
}
47+
4748
pub fn indent(&mut self) {
4849
for _ in 0..self.indent {
4950
self.buf.push(' ');
5051
}
5152
}
53+
5254
pub fn endline(&mut self) {
5355
self.buf.push('\n');
5456
}
57+
5558
pub fn start_block(&mut self) {
5659
self.buf.push('{');
5760
self.endline();
5861
self.indent += self.style.indent;
5962
}
63+
6064
pub fn end_block(&mut self) {
6165
self.indent = self.indent.checked_sub(self.style.indent)
6266
.expect("negative indent");
6367
self.indent();
6468
self.buf.push('}');
6569
self.endline();
6670
}
71+
6772
pub fn margin(&mut self) {
6873
if !self.buf.is_empty() {
6974
self.buf.push('\n');
7075
}
7176
}
77+
7278
pub fn write(&mut self, s: &str) {
7379
self.buf.push_str(s);
7480
}
81+
7582
pub fn into_string(self) -> String {
7683
self.buf
7784
}
85+
7886
pub fn write_quoted(&mut self, s: &str) {
7987
let mut has_newline = false;
8088
let mut has_nonprintable = false;

src/helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl<'a> Parser for Value<'a> {
8989
c.kind == self.kind && c.value == self.value
9090
}).parse_lazy(input)
9191
}
92+
9293
fn add_error(&mut self,
9394
error: &mut Tracked<<Self::Input as StreamOnce>::Error>)
9495
{

0 commit comments

Comments
 (0)