Skip to content

Commit

Permalink
Issue 5236 - [patch] std.format.formattedRead/unformatValue does not …
Browse files Browse the repository at this point in the history
…support the raw reading of integer types
  • Loading branch information
RazvanN7 committed Dec 6, 2016
1 parent 58374ac commit f5bece9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/format.d
Original file line number Diff line number Diff line change
Expand Up @@ -4300,9 +4300,9 @@ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec)
{
import std.algorithm.searching : find;
import std.conv : parse, text;
if (spec.spec == 's')
static if (is(typeof(parse!T(input)) == T))
{
static if(__traits(compiles, parse!T(input)) ) return parse!T(input);
if (spec.spec == `s`) return parse!T(input);
}
enforce(find(acceptedSpecs!long, spec.spec).length,
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));
Expand Down Expand Up @@ -4359,7 +4359,7 @@ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec)
enforce(spec.spec == 's',
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));

static if(__traits(compiles, parse!T(input)) ) return parse!T(input);
return parse!T(input);
}

/**
Expand Down

0 comments on commit f5bece9

Please sign in to comment.