Skip to content

Commit 8510c1b

Browse files
committed
Replace scoped template to scope allocation
1 parent 93c8ed3 commit 8510c1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.d

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import std.format : format, formattedRead;
1111
import std.getopt;
1212
import std.path : baseName, dirName;
1313
import std.stdio;
14-
import std.typecons : scoped;
1514
import core.stdc.stdlib : exit;
1615
import blake2d : BLAKE2D_VERSION_STRING;
1716
import sha3d : SHA3D_VERSION_STRING;
@@ -450,14 +449,14 @@ int hashMmfile(const(char)[] path)
450449

451450
if (size)
452451
{
453-
auto mmfile = scoped!MmFile(cast(string)path);
452+
scope mmfile = new MmFile(cast(string)path);
454453

455454
foreach (chunk; chunks(cast(ubyte[]) mmfile[], settings.bufferSize))
456455
{
457456
settings.hasher.put(chunk);
458457
}
459458
}
460-
459+
461460
settings.rawHash = settings.hasher.finish();
462461
settings.hasher.reset();
463462
return 0;

0 commit comments

Comments
 (0)