| ... | @@ -769,12 +769,18 @@ pub fn printValue( | ... | @@ -769,12 +769,18 @@ pub fn printValue( |
| 769 | }, | 769 | }, |
| 770 | .slice => { | 770 | .slice => { |
| 771 | if (actual_fmt.len == 0) | 771 | if (actual_fmt.len == 0) |
| 772 | @compileError("cannot format slice without a specifier (i.e. {s} or {any})"); | 772 | @compileError("cannot format slice without a specifier (i.e. {s}, {x}, or {any})"); |
| 773 | if (max_depth == 0) { | 773 | if (max_depth == 0) { |
| 774 | return bw.writeAll("{ ... }"); | 774 | return bw.writeAll("{ ... }"); |
| 775 | } | 775 | } |
| 776 | if (actual_fmt[0] == 's' and ptr_info.child == u8) { | 776 | if (ptr_info.child == u8) { |
| 777 | return alignBufferOptions(bw, value, options); | 777 | if (actual_fmt[0] == 's') { |
| | 778 | return alignBufferOptions(bw, value, options); |
| | 779 | } else if (actual_fmt[0] == 'x') { |
| | 780 | return printHex(bw, value, .lower); |
| | 781 | } else if (actual_fmt[0] == 'X') { |
| | 782 | return printHex(bw, value, .upper); |
| | 783 | } |
| 778 | } | 784 | } |
| 779 | try bw.writeAll("{ "); | 785 | try bw.writeAll("{ "); |
| 780 | for (value, 0..) |elem, i| { | 786 | for (value, 0..) |elem, i| { |
| ... | @@ -792,8 +798,14 @@ pub fn printValue( | ... | @@ -792,8 +798,14 @@ pub fn printValue( |
| 792 | if (max_depth == 0) { | 798 | if (max_depth == 0) { |
| 793 | return bw.writeAll("{ ... }"); | 799 | return bw.writeAll("{ ... }"); |
| 794 | } | 800 | } |
| 795 | if (actual_fmt[0] == 's' and info.child == u8) { | 801 | if (info.child == u8) { |
| 796 | return alignBufferOptions(bw, &value, options); | 802 | if (actual_fmt[0] == 's') { |
| | 803 | return alignBufferOptions(bw, &value, options); |
| | 804 | } else if (actual_fmt[0] == 'x') { |
| | 805 | return printHex(bw, &value, .lower); |
| | 806 | } else if (actual_fmt[0] == 'X') { |
| | 807 | return printHex(bw, &value, .upper); |
| | 808 | } |
| 797 | } | 809 | } |
| 798 | try bw.writeAll("{ "); | 810 | try bw.writeAll("{ "); |
| 799 | for (value, 0..) |elem, i| { | 811 | for (value, 0..) |elem, i| { |