From 8e55e340c847d4bfffa153e560fe12612ddfd3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Sat, 18 Sep 2021 17:13:25 +0200 Subject: [PATCH 1/2] Use const paramater in mir.format.text to reduce template bloat --- source/mir/format.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mir/format.d b/source/mir/format.d index ef27bdd6..03edf2e4 100644 --- a/source/mir/format.d +++ b/source/mir/format.d @@ -59,7 +59,7 @@ unittest } /// Concatenated string results -string text(string separator = "", A...)(auto ref A args) +string text(string separator = "", A...)(auto ref const(A) args) if (A.length > 0) { static if (A.length == 1) @@ -406,7 +406,7 @@ ref W printEscaped(C, EscapeFormat escapeFormat = EscapeFormat.ion, W)(scope ret @safe pure nothrow @nogc version (mir_test) unittest { - + import mir.format: stringBuf; stringBuf w; assert(w.printEscaped("Hi \a\v\0\f\t\b \\\r\n" ~ `"@nogc"`).data == `Hi \a\v\0\f\t\b \\\r\n\"@nogc\"`); From 38aa2faa33ee54c15c7aee2b3bcc1adb55e7f432 Mon Sep 17 00:00:00 2001 From: Ilya Yaroshenko Date: Mon, 20 Sep 2021 11:10:31 +0700 Subject: [PATCH 2/2] Update format.d --- source/mir/format.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mir/format.d b/source/mir/format.d index f4972569..464995ac 100644 --- a/source/mir/format.d +++ b/source/mir/format.d @@ -59,8 +59,8 @@ unittest } /// Concatenated string results -string text(string separator = "", A...)(auto ref const(Args) args) - if (Args.length > 0) +string text(string separator = "", Args...)(auto ref const(Args) args) + if (Args.length > 0) { static if (Args.length == 1) {