Skip to content

Commit f9eca21

Browse files
committed
etc: Modernize the indenter
1 parent 35a93e6 commit f9eca21

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/etc/indenter

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
24

3-
$indent = 0;
5+
my $indent = 0;
46
while (<>) {
57
if (/^rust: ">>/) {
68
$indent += 1;
79
} elsif (/^rust: "<</) {
810
$indent -= 1;
911
}
1012

11-
printf "%03d ", $indent;
12-
for ($i = 0; $i < $indent; $i++) {
13-
printf(" ");
14-
}
15-
print;
13+
printf "%03d %s%s", $indent, (" " x $indent), $_;
1614
}
1715

0 commit comments

Comments
 (0)