| ... | ... | @@ -769,12 +769,18 @@ pub fn printValue( |
| 769 | 769 | }, |
| 770 | 770 | .slice => { |
| 771 | 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 | 773 | if (max_depth == 0) { |
| 774 | 774 | return bw.writeAll("{ ... }"); |
| 775 | 775 | } |
| 776 | | if (actual_fmt[0] == 's' and ptr_info.child == u8) { |
| 777 | | return alignBufferOptions(bw, value, options); |
| 776 | if (ptr_info.child == u8) { |
| 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 | 785 | try bw.writeAll("{ "); |
| 780 | 786 | for (value, 0..) |elem, i| { |
| ... | ... | @@ -792,8 +798,14 @@ pub fn printValue( |
| 792 | 798 | if (max_depth == 0) { |
| 793 | 799 | return bw.writeAll("{ ... }"); |
| 794 | 800 | } |
| 795 | | if (actual_fmt[0] == 's' and info.child == u8) { |
| 796 | | return alignBufferOptions(bw, &value, options); |
| 801 | if (info.child == u8) { |
| 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 | 810 | try bw.writeAll("{ "); |
| 799 | 811 | for (value, 0..) |elem, i| { |