Skip to content

Commit

Permalink
chore: replace unnecessary vars
Browse files Browse the repository at this point in the history
This restores compatibility with the latest Zig master.
  • Loading branch information
ianprime0509 committed Nov 19, 2023
1 parent f4bfcbe commit e593568
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ pub fn Reader(comptime ReaderType: type, comptime options: ReaderOptions) type {
return .{ .element_end = .{ .name = qname } };
},
.attribute_start => {
var attr_entry = try self.pending_event.element_start.attributes.getOrPut(
const attr_entry = try self.pending_event.element_start.attributes.getOrPut(
event_allocator,
self.token_reader.token_data.attribute_start.name,
);
Expand Down Expand Up @@ -621,7 +621,7 @@ pub fn Reader(comptime ReaderType: type, comptime options: ReaderOptions) type {
const attr_qname = try self.namespace_context.parseName(attr_name, false);
attributes.appendAssumeCapacity(.{ .name = attr_qname, .value = attr_value.items });
if (options.namespace_aware) {
var entry = attr_qnames.getOrPutAssumeCapacity(attr_qname);
const entry = attr_qnames.getOrPutAssumeCapacity(attr_qname);
if (entry.found_existing) {
return error.DuplicateAttribute;
}
Expand Down Expand Up @@ -1032,7 +1032,7 @@ test "nextNode namespace handling" {
var input_reader = reader(testing.allocator, input_stream.reader(), .{});
defer input_reader.deinit();

var root_start = try input_reader.next();
const root_start = try input_reader.next();
try testing.expect(root_start != null and root_start.? == .element_start);
var root_node = try input_reader.nextNode(testing.allocator, root_start.?.element_start);
defer root_node.deinit();
Expand Down

0 comments on commit e593568

Please sign in to comment.