File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -196,10 +196,9 @@ private auto assertWritelnModuleImpl(string fileText)
196
196
{
197
197
import std.string : representation;
198
198
auto fl = FileLines(fileText);
199
- auto visitor = new TestVisitor! (typeof (fl))(fl);
199
+ scope visitor = new TestVisitor! (typeof (fl))(fl);
200
200
// libdparse doesn't allow to work on immutable source code
201
201
parseString(cast (ubyte []) fileText.representation, visitor);
202
- delete visitor;
203
202
return fl;
204
203
}
205
204
@@ -274,9 +273,8 @@ version(unittest)
274
273
{
275
274
import std.string : representation;
276
275
auto mock = FileLinesMock(sourceCode.split(" \n " ));
277
- auto visitor = new TestVisitor! (typeof (mock))(mock);
276
+ scope visitor = new TestVisitor! (typeof (mock))(mock);
278
277
parseString(sourceCode.representation.dup , visitor);
279
- delete visitor;
280
278
return mock;
281
279
}
282
280
}
You can’t perform that action at this time.
0 commit comments