| ... | ... | @@ -1172,6 +1172,25 @@ pub fn printValue( |
| 1172 | 1172 | }, |
| 1173 | 1173 | else => invalidFmtError(fmt, value), |
| 1174 | 1174 | }, |
| 1175 | // TODO make this print double quotes and quote-escape the string |
| 1176 | // according to zig string syntax rules |
| 1177 | 'q' => switch (@typeInfo(T)) { |
| 1178 | .pointer => |info| switch (info.size) { |
| 1179 | .one, .slice => { |
| 1180 | const slice: []const u8 = value; |
| 1181 | return w.alignBufferOptions(slice, options); |
| 1182 | }, |
| 1183 | .many, .c => { |
| 1184 | const slice: [:0]const u8 = std.mem.span(value); |
| 1185 | return w.alignBufferOptions(slice, options); |
| 1186 | }, |
| 1187 | }, |
| 1188 | .array => { |
| 1189 | const slice: []const u8 = &value; |
| 1190 | return w.alignBufferOptions(slice, options); |
| 1191 | }, |
| 1192 | else => invalidFmtError(fmt, value), |
| 1193 | }, |
| 1175 | 1194 | 'B' => switch (@typeInfo(T)) { |
| 1176 | 1195 | .int, .comptime_int => return w.printByteSize(value, .decimal, options), |
| 1177 | 1196 | .@"struct" => return value.formatByteSize(w, .decimal), |