Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
{
"name": "unittest",
"dflags": ["-preview=dip1000"],
"sourceFiles": [ "tests/unit/*.d" ]
}
],
Expand Down
6 changes: 3 additions & 3 deletions source/configy/backend/keyvalue.d
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class KeyValueMapping : Mapping {
return Location(this.prefix.length ? this.prefix[0 .. $ - 1] : null);
}
public override Type type () const scope @safe nothrow { return Type.Mapping; }
public override inout(KeyValueMapping) asMapping () inout scope @safe { return this; }
public override inout(KeyValueMapping) asMapping () inout return scope @safe { return this; }
public override inout(Sequence) asSequence () inout scope @safe { return null; }
public override inout(Scalar) asScalar () inout scope @safe { return null; }

Expand Down Expand Up @@ -205,7 +205,7 @@ public class SequenceOrScalar : Sequence, Scalar {
///
public override inout(Mapping) asMapping () inout scope @safe { return null; }
///
public override inout(SequenceOrScalar) asSequence () inout scope @safe { return this; }
public override inout(SequenceOrScalar) asSequence () inout return scope @safe { return this; }
///
public override inout(SequenceOrScalar) asScalar () inout scope @safe { return this; }
public override inout(SequenceOrScalar) asScalar () inout return scope @safe { return this; }
}
6 changes: 3 additions & 3 deletions source/configy/backend/multi.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class MultiMapping : Mapping {
}

///
public override inout(Mapping) asMapping () inout scope @safe { return this; }
public override inout(Mapping) asMapping () inout return scope @safe { return this; }
public override inout(Sequence) asSequence () inout scope @safe { return null; }
public override inout(Scalar) asScalar () inout scope @safe { return null; }

Expand Down Expand Up @@ -118,13 +118,13 @@ private struct MultiMappingBuffer {
private size_t idx;

/// Adds a node to the buffer - skip any `null` node
public void add (scope Mapping node) @safe scope return {
public void add (Mapping node) @safe scope return {
if (node is null) return;
this.buffer[this.idx++] = node;
}

/// Returns: A slice of the buffer with all non-null node
public Mapping[] opSlice () @safe scope return {
public Mapping[] opSlice () @safe return {
return this.buffer[0 .. this.idx];
}

Expand Down
2 changes: 1 addition & 1 deletion source/configy/backend/node.d
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ public class SimpleScalar : Scalar {
///
public override inout(Sequence) asSequence () inout scope @safe { return null; }
///
public override inout(SimpleScalar) asScalar () inout scope @safe { return this; }
public override inout(SimpleScalar) asScalar () inout return scope @safe { return this; }
}
4 changes: 2 additions & 2 deletions source/configy/utils.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module configy.utils;
import std.format;

/// Type of sink used by the `toString`
package alias SinkType = void delegate (in char[]) @safe;
package alias SinkType = void delegate (const scope char[]) @safe;

/// Convenience function to extend a path
package string addPath (string opath, string newPart) @safe pure nothrow
Expand Down Expand Up @@ -95,7 +95,7 @@ package struct Colored (T)
static if (is(typeof(T.init.length) : size_t))
if (this.value.length == 0) return;

formattedWrite(sink, "%s%s%s", this.color, this.value, Reset);
() @trusted { formattedWrite(sink, "%s%s%s", this.color, this.value, Reset); }();
}
}

Expand Down
Loading