소스 검색

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-zig
 > git clone https://github.com/floooh/sokol-nim
 > git clone https://github.com/floooh/sokol-nim
 > git clone https://github.com/floooh/sokol-odin
 > git clone https://github.com/floooh/sokol-odin
+> git clone https://github.com/floooh/sokol-rust
 > python3 gen_all.py
 > python3 gen_all.py
 ```
 ```
 
 

+ 1 - 1
bindgen/gen_zig.py

@@ -497,7 +497,7 @@ def gen_helpers(inp):
         l('};')
         l('};')
         l('// std.fmt-style formatted print')
         l('// std.fmt-style formatted print')
         l('pub fn print(comptime fmt: anytype, args: anytype) void {')
         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('    @import("std").fmt.format(writer, fmt, args) catch {};')
         l('}')
         l('}')
         l('')
         l('')