From 14a8e31fa5ddb596b0f01aef1ecde96507f44373 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Sat, 26 Jul 2014 18:20:57 +0200 Subject: [PATCH] Minor cleanup. --- source/dyaml/scanner.d | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/dyaml/scanner.d b/source/dyaml/scanner.d index 7f4cd0c..470aef8 100644 --- a/source/dyaml/scanner.d +++ b/source/dyaml/scanner.d @@ -249,7 +249,7 @@ final class Scanner /// Most scanning error messages have the same format; so build them with this /// function. - string expected(T)(string expected, T found) @safe pure nothrow @nogc + string expected(T)(string expected, T found) @safe pure nothrow @nogc { return buildMsg("expected ", expected, ", but found ", found); } @@ -937,12 +937,9 @@ final class Scanner // Scan directive name reader_.sliceBuilder.begin(); - { - scope(failure) { reader_.sliceBuilder.finish(); } - scanDirectiveNameToSlice(startMark); - throwIfError(); - } - const name = reader_.sliceBuilder.finish(); + scanDirectiveNameToSlice(startMark); + throwIfError(); + const name = reader_.sliceBuilder.finish(); reader_.sliceBuilder.begin();