From c160156346703d81a0cdd22d0a04fd265e20785f Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Sat, 2 Aug 2014 23:25:56 +0200 Subject: [PATCH] Fixed the string->char[] Token value move. --- source/dyaml/reader.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dyaml/reader.d b/source/dyaml/reader.d index 03c0bc2..b9cf43d 100644 --- a/source/dyaml/reader.d +++ b/source/dyaml/reader.d @@ -401,14 +401,14 @@ public: /// /// Returns a string; once a slice is finished it is definitive that its contents /// will not be changed. - string finish() @system pure nothrow @nogc + char[] finish() @system pure nothrow @nogc { assert(inProgress, "finish called without begin"); assert(endStackUsed_ == 0, "Finishing a slice with running transactions."); - const result = reader_.buffer_[start_ .. end_]; + auto result = reader_.buffer_[start_ .. end_]; start_ = end_ = size_t.max; - return cast(string)result; + return result; } /// Write a string to the slice being built.