authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2021-02-17 20:28:12-07:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-02-21 11:55:21+02:00
loga448210fcf9a4c6671ed1073af1d3742600975b2
tree059469467dfb4c9d1e6b3c9b72dce1f057354bcf
parentf9be7471bc9a35fcb872a83564d41cdf561ca173

remove z/Z format specifier deprecations

The z/Z format specifiers were merged last October (4 months ago). They were then deprecated in January (just over a month ago). This PR removes them altogether.

1 files changed, 4 insertions(+), 10 deletions(-)

lib/std/fmt.zig+4-10
......@@ -524,7 +524,7 @@ pub fn formatType(
524524 if (actual_fmt.len == 0)
525525 @compileError("cannot format array ref without a specifier (i.e. {s} or {*})");
526526 if (info.child == u8) {
527 if (comptime mem.indexOfScalar(u8, "sxXeEzZ", actual_fmt[0]) != null) {
527 if (comptime mem.indexOfScalar(u8, "sxXeE", actual_fmt[0]) != null) {
528528 return formatText(value, actual_fmt, options, writer);
529529 }
530530 }
......@@ -542,7 +542,7 @@ pub fn formatType(
542542 return formatType(mem.span(value), actual_fmt, options, writer, max_depth);
543543 }
544544 if (ptr_info.child == u8) {
545 if (comptime mem.indexOfScalar(u8, "sxXeEzZ", actual_fmt[0]) != null) {
545 if (comptime mem.indexOfScalar(u8, "sxXeE", actual_fmt[0]) != null) {
546546 return formatText(mem.span(value), actual_fmt, options, writer);
547547 }
548548 }
......@@ -555,7 +555,7 @@ pub fn formatType(
555555 return writer.writeAll("{ ... }");
556556 }
557557 if (ptr_info.child == u8) {
558 if (comptime mem.indexOfScalar(u8, "sxXeEzZ", actual_fmt[0]) != null) {
558 if (comptime mem.indexOfScalar(u8, "sxXeE", actual_fmt[0]) != null) {
559559 return formatText(value, actual_fmt, options, writer);
560560 }
561561 }
......@@ -576,7 +576,7 @@ pub fn formatType(
576576 return writer.writeAll("{ ... }");
577577 }
578578 if (info.child == u8) {
579 if (comptime mem.indexOfScalar(u8, "sxXeEzZ", actual_fmt[0]) != null) {
579 if (comptime mem.indexOfScalar(u8, "sxXeE", actual_fmt[0]) != null) {
580580 return formatText(&value, actual_fmt, options, writer);
581581 }
582582 }
......@@ -658,8 +658,6 @@ pub fn formatIntValue(
658658 } else {
659659 @compileError("Cannot print integer that is larger than 8 bits as a ascii");
660660 }
661 } else if (comptime std.mem.eql(u8, fmt, "Z")) {
662 @compileError("specifier 'Z' has been deprecated, wrap your argument in std.zig.fmtEscapes instead");
663661 } else if (comptime std.mem.eql(u8, fmt, "u")) {
664662 if (@typeInfo(@TypeOf(int_value)).Int.bits <= 21) {
665663 return formatUnicodeCodepoint(@as(u21, int_value), options, writer);
......@@ -735,10 +733,6 @@ pub fn formatText(
735733 }
736734 }
737735 return;
738 } else if (comptime std.mem.eql(u8, fmt, "z")) {
739 @compileError("specifier 'z' has been deprecated, wrap your argument in std.zig.fmtId instead");
740 } else if (comptime std.mem.eql(u8, fmt, "Z")) {
741 @compileError("specifier 'Z' has been deprecated, wrap your argument in std.zig.fmtEscapes instead");
742736 } else {
743737 @compileError("Unsupported format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
744738 }