Remove #2725 workaround

These were no longer being hit after the copy-elision branch was merged.

Closes #2725.
This commit is contained in:
Marc Tiehuis 2019-06-27 21:50:24 +12:00
parent 6c195ede54
commit 3c914c63a5

View File

@ -443,13 +443,9 @@ fn formatValue(
output: fn (@typeOf(context), []const u8) Errors!void, output: fn (@typeOf(context), []const u8) Errors!void,
) Errors!void { ) Errors!void {
if (comptime std.mem.eql(u8, fmt, "B")) { if (comptime std.mem.eql(u8, fmt, "B")) {
// TODO https://github.com/ziglang/zig/issues/2725 return formatBytes(value, options.width, 1000, context, Errors, output);
if (options.width) |w| return formatBytes(value, w, 1000, context, Errors, output);
return formatBytes(value, null, 1000, context, Errors, output);
} else if (comptime std.mem.eql(u8, fmt, "Bi")) { } else if (comptime std.mem.eql(u8, fmt, "Bi")) {
// TODO https://github.com/ziglang/zig/issues/2725 return formatBytes(value, options.width, 1024, context, Errors, output);
if (options.width) |w| return formatBytes(value, w, 1024, context, Errors, output);
return formatBytes(value, null, 1024, context, Errors, output);
} }
const T = @typeOf(value); const T = @typeOf(value);
@ -499,9 +495,7 @@ pub fn formatIntValue(
@compileError("Unknown format string: '" ++ fmt ++ "'"); @compileError("Unknown format string: '" ++ fmt ++ "'");
} }
// TODO https://github.com/ziglang/zig/issues/2725 return formatInt(int_value, radix, uppercase, options.width orelse 0, context, Errors, output);
if (options.width) |w| return formatInt(int_value, radix, uppercase, w, context, Errors, output);
return formatInt(int_value, radix, uppercase, 0, context, Errors, output);
} }
fn formatFloatValue( fn formatFloatValue(
@ -513,13 +507,9 @@ fn formatFloatValue(
output: fn (@typeOf(context), []const u8) Errors!void, output: fn (@typeOf(context), []const u8) Errors!void,
) Errors!void { ) Errors!void {
if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) { if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) {
// TODO https://github.com/ziglang/zig/issues/2725 return formatFloatScientific(value, options.precision, context, Errors, output);
if (options.precision) |p| return formatFloatScientific(value, p, context, Errors, output);
return formatFloatScientific(value, null, context, Errors, output);
} else if (comptime std.mem.eql(u8, fmt, "d")) { } else if (comptime std.mem.eql(u8, fmt, "d")) {
// TODO https://github.com/ziglang/zig/issues/2725 return formatFloatDecimal(value, options.precision, context, Errors, output);
if (options.precision) |p| return formatFloatDecimal(value, p, context, Errors, output);
return formatFloatDecimal(value, null, context, Errors, output);
} else { } else {
@compileError("Unknown format string: '" ++ fmt ++ "'"); @compileError("Unknown format string: '" ++ fmt ++ "'");
} }