ソースを参照

Merge pull request #948 from abhirag/master

Using const for local variables that are never mutated in Zig bindings
Andre Weissflog 1 年間 前
コミット
b0ee2d3780
2 ファイル変更2 行追加1 行削除
  1. 1 0
      bindgen/README.md
  2. 1 1
      bindgen/gen_zig.py

+ 1 - 0
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
 ```
 

+ 1 - 1
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('')