aboutsummaryrefslogtreecommitdiff
path: root/src/resinator/code_pages.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/code_pages.zig
parent172c2797bdd5f939e53acc26ea6820896e62733a (diff)
downloadzig-b35589343894791a48b1423aa6d4a59b4858dfdb.tar.gz
zig-b35589343894791a48b1423aa6d4a59b4858dfdb.zip
compiler: correct unnecessary uses of 'var'
Diffstat (limited to 'src/resinator/code_pages.zig')
-rw-r--r--src/resinator/code_pages.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/resinator/code_pages.zig b/src/resinator/code_pages.zig
index 4b9a87ce7a..be89ed3f02 100644
--- a/src/resinator/code_pages.zig
+++ b/src/resinator/code_pages.zig
@@ -302,8 +302,8 @@ pub const Utf8 = struct {
pub fn decode(bytes: []const u8) Codepoint {
std.debug.assert(bytes.len > 0);
- var first_byte = bytes[0];
- var expected_len = sequenceLength(first_byte) orelse {
+ const first_byte = bytes[0];
+ const expected_len = sequenceLength(first_byte) orelse {
return .{ .value = Codepoint.invalid, .byte_len = 1 };
};
if (expected_len == 1) return .{ .value = first_byte, .byte_len = 1 };
@@ -367,7 +367,7 @@ pub const Utf8 = struct {
test "Utf8.WellFormedDecoder" {
const invalid_utf8 = "\xF0\x80";
- var decoded = Utf8.WellFormedDecoder.decode(invalid_utf8);
+ const decoded = Utf8.WellFormedDecoder.decode(invalid_utf8);
try std.testing.expectEqual(Codepoint.invalid, decoded.value);
try std.testing.expectEqual(@as(usize, 2), decoded.byte_len);
}