Skip to content

Commit cd0d6b8

Browse files
committed
Take advantage of span-tree(Str:D) in examples
1 parent 67fb62c commit cd0d6b8

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/debugger-mockup.raku

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,9 @@ class DebuggerMockup is TopLevel {
9595
my $lineno = $i + 1;
9696
my $lineno-span = $lineno == 7
9797
?? string-span($lineno ~ '>', color => 'bold yellow')
98-
!! string-span($lineno ~ ' ');
98+
!! $lineno ~ ' ';
9999
my $pad-span = pad-span($max-lineno-width - $lineno.chars);
100-
$source.add-entry(span-tree($pad-span,
101-
$lineno-span,
102-
string-span(''),
103-
string-span($line)));
100+
$source.add-entry(span-tree($pad-span, $lineno-span, '', $line));
104101
}
105102

106103
$inspector.add-entry: q:to/INSPECTOR/;

examples/dir-tree.raku

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class DirTreeDemo is TopLevel {
3838

3939
my sub format-line(Str:D $label, Str:D() $value) {
4040
span-tree(string-span($label, color => 'bold yellow'),
41-
string-span(' ' x 10 - $label.chars),
42-
string-span($value))
41+
pad-span(10 - $label.chars),
42+
$value)
4343
}
4444

4545
$details.add-entry(format-line('Path', $path));

0 commit comments

Comments
 (0)