From 577e06bbb40edbe2158bf1ccba6da39d5011babb Mon Sep 17 00:00:00 2001 From: abhirag Date: Fri, 1 Dec 2023 21:17:56 +0530 Subject: Using const for local variables that are never mutated --- bindgen/README.md | 1 + bindgen/gen_zig.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bindgen/README.md b/bindgen/README.md index f90e499c..0b9b6964 100644 --- a/bindgen/README.md +++ b/bindgen/README.md @@ -23,6 +23,7 @@ To update the Zig bindings: > git clone https://github.com/floooh/sokol-zig > git clone https://github.com/floooh/sokol-nim > git clone https://github.com/floooh/sokol-odin +> git clone https://github.com/floooh/sokol-rust > python3 gen_all.py ``` diff --git a/bindgen/gen_zig.py b/bindgen/gen_zig.py index cef75e9e..d66630f4 100644 --- a/bindgen/gen_zig.py +++ b/bindgen/gen_zig.py @@ -497,7 +497,7 @@ def gen_helpers(inp): l('};') l('// std.fmt-style formatted print') l('pub fn print(comptime fmt: anytype, args: anytype) void {') - l(' var writer: Writer = .{};') + l(' const writer: Writer = .{};') l(' @import("std").fmt.format(writer, fmt, args) catch {};') l('}') l('') -- cgit v1.2.3