Skip to content

Commit

Permalink
remove @safe from template setTimes
Browse files Browse the repository at this point in the history
Letting attribute inference take care of things. Making a unittest @safe
to ensure that setTimes itself doesn't do anything unsafe.
  • Loading branch information
aG0aep6G committed Feb 3, 2016
1 parent 4be6bc1 commit 81b15b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/file.d
Expand Up @@ -1074,7 +1074,7 @@ version(Windows) unittest
+/
void setTimes(R)(R name,
SysTime accessTime,
SysTime modificationTime) @safe
SysTime modificationTime)
if (isInputRange!R && isSomeChar!(ElementEncodingType!R) &&
!isConvertibleToString!R)
{
Expand Down Expand Up @@ -1146,13 +1146,13 @@ void setTimes(R)(R name,

void setTimes(R)(auto ref R name,
SysTime accessTime,
SysTime modificationTime) @safe
SysTime modificationTime)
if (isConvertibleToString!R)
{
setTimes!(StringTypeOf!R)(name, accessTime, modificationTime);
}

unittest
@safe unittest
{
static assert(__traits(compiles, setTimes(TestAliasedString("foo"), SysTime.init, SysTime.init)));
}
Expand Down

0 comments on commit 81b15b7

Please sign in to comment.