Skip to content

Commit

Permalink
Fixup Formatter to use 'in' for toString
Browse files Browse the repository at this point in the history
This was missed in the previous commit as the CI does not test '-preview=in'.
  • Loading branch information
Geod24 committed Dec 8, 2021
1 parent f1d0292 commit 2eaf3f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ocean/text/convert/Formatter.d
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private void handle (T) (T v, FormatInfo f, scope FormatterSink sf, scope ElemSi
// Note: sink `toString` overload should take a `scope` delegate
else static if (is(typeof(v.toString(sf))))
nullWrapper(&v,
v.toString((cstring e) { se(e, f); }),
v.toString((in cstring e) { se(e, f); }),
se("null", f));
else static if (is(typeof(v.toString()) : cstring))
nullWrapper(&v, se(v.toString(), f), se("null", f));
Expand Down
6 changes: 3 additions & 3 deletions src/ocean/util/log/Appender.d
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public class AppendNull : Appender
/// Append an event to the output
final override void append (LogEvent event)
{
this.layout.format(event, (cstring) {});
this.layout.format(event, (in cstring) {});
}
}

Expand Down Expand Up @@ -271,7 +271,7 @@ public class AppendStream : Appender
{
static immutable istring Eol = "\n";

this.layout.format(event, (cstring content) { this.stream_.write(content); });
this.layout.format(event, (in cstring content) { this.stream_.write(content); });
this.stream_.write(Eol);
if (this.flush_)
this.stream_.flush;
Expand Down Expand Up @@ -307,7 +307,7 @@ unittest
result.length = 0;
assumeSafeAppend(result);

scope dg = (cstring v) { result ~= v; };
scope dg = (in cstring v) { result ~= v; };
scope layout = new LayoutTimer();
LogEvent event = {
msg_: "Have you met Ted?",
Expand Down
2 changes: 1 addition & 1 deletion src/ocean/util/log/LayoutDate.d
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ unittest
result.length = 0;
assumeSafeAppend(result);

scope dg = (cstring v) { result ~= v; };
scope dg = (in cstring v) { result ~= v; };
scope layout = new LayoutDate(false);
LogEvent event = {
msg_: "Have you met Ted?",
Expand Down

0 comments on commit 2eaf3f6

Please sign in to comment.