Skip to content

Commit e245e32

Browse files
add an extra space for padding on the first line
1 parent 9434229 commit e245e32

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

examples/no-indent.stdout

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
1:mainno_indent::hierarchical-example version=0.1
2-
1:main no_indent::server host="localhost", port=8080
3-
1:main ms INFO no_indent starting
4-
1:main ms INFO no_indent listening
5-
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
6-
1:main ms DEBUG no_indent connected
7-
1:main ms DEBUG no_indent message received, length=2
8-
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
9-
1:main ms DEBUG no_indent connected
10-
1:main no_indent::foomp 42 <- format string, normal_var=43
11-
1:main ms ERROR no_indent hello
12-
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
13-
1:main ms WARN no_indent weak encryption requested, algo="xor"
14-
1:main ms DEBUG no_indent response sent, length=8
15-
1:main ms DEBUG no_indent disconnected
16-
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
17-
1:main ms DEBUG no_indent message received, length=5
18-
1:main ms DEBUG no_indent response sent, length=8
19-
1:main ms DEBUG no_indent disconnected
20-
1:main ms WARN no_indent internal error
21-
1:main ms INFO no_indent exit
1+
1:main no_indent::hierarchical-example version=0.1
2+
1:main no_indent::server host="localhost", port=8080
3+
1:main ms INFO no_indent starting
4+
1:main ms INFO no_indent listening
5+
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
6+
1:main ms DEBUG no_indent connected
7+
1:main ms DEBUG no_indent message received, length=2
8+
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
9+
1:main ms DEBUG no_indent connected
10+
1:main no_indent::foomp 42 <- format string, normal_var=43
11+
1:main ms ERROR no_indent hello
12+
1:main no_indent::conn peer_addr="82.9.9.9", port=42381
13+
1:main ms WARN no_indent weak encryption requested, algo="xor"
14+
1:main ms DEBUG no_indent response sent, length=8
15+
1:main ms DEBUG no_indent disconnected
16+
1:main no_indent::conn peer_addr="8.8.8.8", port=18230
17+
1:main ms DEBUG no_indent message received, length=5
18+
1:main ms DEBUG no_indent response sent, length=8
19+
1:main ms DEBUG no_indent disconnected
20+
1:main ms WARN no_indent internal error
21+
1:main ms INFO no_indent exit

src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fn indent_block(
415415
if indent_lines {
416416
indent_block_with_lines(&lines, buf, indent, indent_amount, prefix, style);
417417
} else {
418-
let indent_str = String::from(" ").repeat(indent_spaces);
418+
let indent_str = String::from(" ").repeat(indent_spaces + 1);
419419
for line in lines {
420420
buf.push_str(prefix);
421421
buf.push_str(&indent_str);

0 commit comments

Comments
 (0)