Skip to content

Commit

Permalink
std: remove unused std.fmt.Parser buf field
Browse files Browse the repository at this point in the history
And make the initialization less error prone by removing a default for
iter, which is required for a functional parser
  • Loading branch information
raindev committed Nov 15, 2024
1 parent bfcf18c commit e704233
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/std/fmt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ pub const Placeholder = struct {
pub fn parse(comptime str: anytype) Placeholder {
const view = std.unicode.Utf8View.initComptime(&str);
comptime var parser = Parser{
.buf = &str,
.iter = view.iterator(),
};

Expand Down Expand Up @@ -312,9 +311,8 @@ pub const Specifier = union(enum) {
};

pub const Parser = struct {
buf: []const u8,
pos: usize = 0,
iter: std.unicode.Utf8Iterator = undefined,
iter: std.unicode.Utf8Iterator,

// Returns a decimal number or null if the current character is not a
// digit
Expand Down

0 comments on commit e704233

Please sign in to comment.