| ... | ... | @@ -511,11 +511,11 @@ pub const HexEscape = struct { |
| 511 | 511 | }; |
| 512 | 512 | |
| 513 | 513 | /// Replaces non-ASCII bytes with hex escapes. |
| 514 | | pub fn hexEscape(bytes: []const u8, case: std.fmt.Case) std.fmt.Alt(HexEscape, HexEscape.format) { |
| 515 | | return .{ .data = .{ .bytes = bytes, .charset = switch (case) { |
| 514 | pub fn hexEscape(bytes: []const u8, case: std.fmt.Case) HexEscape { |
| 515 | return .{ .bytes = bytes, .charset = switch (case) { |
| 516 | 516 | .lower => HexEscape.lower_charset, |
| 517 | 517 | .upper => HexEscape.upper_charset, |
| 518 | | } } }; |
| 518 | } }; |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | test hexEscape { |