Skip to content

Commit 1360883

Browse files
authored
Use strformat.fmt rather than strutils.% in features.html
This is the page I often use to show off nim, so it should be a showcase of the best features.
1 parent 3cec5fc commit 1360883

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jekyll/features.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>
2727
</div>
2828
<div class="pure-u-1 pure-u-md-1-2 center">
2929
{% highlight nim %}
30-
import strutils
30+
import strformat
3131
type
3232
Person = object
3333
name*: string # Field is exported using `*`.
@@ -39,7 +39,8 @@ <h2>
3939
]
4040

4141
for person in people:
42-
echo("$1 is $2 years old" % [person.name, $person.age]){% endhighlight %}
42+
# Type-safe string interpolation.
43+
echo(fmt"{person.name} is {person.age} years old"){% endhighlight %}
4344
</div>
4445
</div>
4546
</section>

0 commit comments

Comments
 (0)