diff options
| author | abhirag <hey@abhirag.com> | 2023-12-01 21:17:56 +0530 |
|---|---|---|
| committer | abhirag <hey@abhirag.com> | 2023-12-01 21:17:56 +0530 |
| commit | 577e06bbb40edbe2158bf1ccba6da39d5011babb (patch) | |
| tree | f44b53840b7ba790aae3f2d23045d6fdd7b70a70 | |
| parent | db4fde91442cf18fa687a41c01f2376c1d2e6666 (diff) | |
Using const for local variables that are never mutated
| -rw-r--r-- | bindgen/README.md | 1 | ||||
| -rw-r--r-- | bindgen/gen_zig.py | 2 |
2 files changed, 2 insertions, 1 deletions
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('') |