diff --git a/source/dub/internal/vibecompat/core/file.d b/source/dub/internal/vibecompat/core/file.d index 2d8e946..3328458 100644 --- a/source/dub/internal/vibecompat/core/file.d +++ b/source/dub/internal/vibecompat/core/file.d @@ -25,11 +25,12 @@ /* Add output range support to File */ struct RangeFile { +@safe: std.stdio.File file; - void put(in ubyte[] bytes) { file.rawWrite(bytes); } - void put(in char[] str) { put(cast(ubyte[])str); } - void put(char ch) { put((&ch)[0 .. 1]); } + void put(in ubyte[] bytes) @trusted { file.rawWrite(bytes); } + void put(in char[] str) { put(cast(const(ubyte)[])str); } + void put(char ch) @trusted { put((&ch)[0 .. 1]); } void put(dchar ch) { char[4] chars; put(chars[0 .. encode(chars, ch)]); } ubyte[] readAll() @@ -42,7 +43,7 @@ return ret; } - void rawRead(ubyte[] dst) { enforce(file.rawRead(dst).length == dst.length, "Failed to readall bytes from file."); } + void rawRead(ubyte[] dst) @trusted { enforce(file.rawRead(dst).length == dst.length, "Failed to readall bytes from file."); } void write(string str) { put(str); } void close() { file.close(); } void flush() { file.flush(); }