| ... | ... | @@ -224,7 +224,6 @@ pub const Placeholder = struct { |
| 224 | 224 | pub fn parse(comptime str: anytype) Placeholder { |
| 225 | 225 | const view = std.unicode.Utf8View.initComptime(&str); |
| 226 | 226 | comptime var parser = Parser{ |
| 227 | | .buf = &str, |
| 228 | 227 | .iter = view.iterator(), |
| 229 | 228 | }; |
| 230 | 229 | |
| ... | ... | @@ -311,10 +310,13 @@ pub const Specifier = union(enum) { |
| 311 | 310 | named: []const u8, |
| 312 | 311 | }; |
| 313 | 312 | |
| 313 | /// A stream based parser for format strings. |
| 314 | /// |
| 315 | /// Allows to implement formatters compatible with std.fmt without replicating |
| 316 | /// the standard library behavior. |
| 314 | 317 | pub const Parser = struct { |
| 315 | | buf: []const u8, |
| 316 | 318 | pos: usize = 0, |
| 317 | | iter: std.unicode.Utf8Iterator = undefined, |
| 319 | iter: std.unicode.Utf8Iterator, |
| 318 | 320 | |
| 319 | 321 | // Returns a decimal number or null if the current character is not a |
| 320 | 322 | // digit |