aboutsummaryrefslogtreecommitdiff
path: root/src/resinator/source_mapping.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-11-14 09:10:53 +0000
committermlugg <mlugg@mlugg.co.uk>2023-11-19 11:11:49 +0000
commitb35589343894791a48b1423aa6d4a59b4858dfdb (patch)
tree62fb0542c4e49dd8748294bcfb75cf0c12fa5e23 /src/resinator/source_mapping.zig
parent172c2797bdd5f939e53acc26ea6820896e62733a (diff)
downloadzig-b35589343894791a48b1423aa6d4a59b4858dfdb.tar.gz
zig-b35589343894791a48b1423aa6d4a59b4858dfdb.zip
compiler: correct unnecessary uses of 'var'
Diffstat (limited to 'src/resinator/source_mapping.zig')
-rw-r--r--src/resinator/source_mapping.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resinator/source_mapping.zig b/src/resinator/source_mapping.zig
index 27e888f87a..f8f99de401 100644
--- a/src/resinator/source_mapping.zig
+++ b/src/resinator/source_mapping.zig
@@ -251,7 +251,7 @@ pub fn handleLineCommand(allocator: Allocator, line_command: []const u8, current
}
pub fn parseAndRemoveLineCommandsAlloc(allocator: Allocator, source: []const u8, options: ParseAndRemoveLineCommandsOptions) !ParseLineCommandsResult {
- var buf = try allocator.alloc(u8, source.len);
+ const buf = try allocator.alloc(u8, source.len);
errdefer allocator.free(buf);
var result = try parseAndRemoveLineCommands(allocator, source, buf, options);
result.result = try allocator.realloc(buf, result.result.len);
@@ -440,7 +440,7 @@ pub const SourceMappings = struct {
}
pub fn set(self: *SourceMappings, allocator: Allocator, line_num: usize, span: SourceSpan) !void {
- var ptr = try self.expandAndGet(allocator, line_num);
+ const ptr = try self.expandAndGet(allocator, line_num);
ptr.* = span;
}