diff options
| author | 2021-05-08 18:08:52 +0200 | |
|---|---|---|
| committer | 2021-05-08 18:08:52 +0200 | |
| commit | 4c14bfd5188bb61d7076bc33fccbcc6a5e9dac01 (patch) | |
| tree | 8f5267e4da9bbc14bd595697797457911d4b3081 /build.zig | |
| parent | Refactor Diagnostic (and others) into a ParseOption struct (diff) | |
| download | zig-clap-4c14bfd5188bb61d7076bc33fccbcc6a5e9dac01.tar.gz zig-clap-4c14bfd5188bb61d7076bc33fccbcc6a5e9dac01.tar.xz zig-clap-4c14bfd5188bb61d7076bc33fccbcc6a5e9dac01.zip | |
Modernize codebase
* Better naming for variables
* Follow naming style of enums
* Use `writer()` instead of `outStream()`
* Change many initializers to be a one liner
* Don't explicitly initialize fields to their default value
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,8 +1,8 @@ | |||
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | const Mode = builtin.Mode; | ||
| 5 | const Builder = std.build.Builder; | 4 | const Builder = std.build.Builder; |
| 5 | const Mode = builtin.Mode; | ||
| 6 | 6 | ||
| 7 | pub fn build(b: *Builder) void { | 7 | pub fn build(b: *Builder) void { |
| 8 | const mode = b.standardReleaseOptions(); | 8 | const mode = b.standardReleaseOptions(); |
| @@ -58,7 +58,7 @@ fn readMeStep(b: *Builder) *std.build.Step { | |||
| 58 | fn make(step: *std.build.Step) anyerror!void { | 58 | fn make(step: *std.build.Step) anyerror!void { |
| 59 | @setEvalBranchQuota(10000); | 59 | @setEvalBranchQuota(10000); |
| 60 | const file = try std.fs.cwd().createFile("README.md", .{}); | 60 | const file = try std.fs.cwd().createFile("README.md", .{}); |
| 61 | const stream = &file.outStream(); | 61 | const stream = file.writer(); |
| 62 | try stream.print(@embedFile("example/README.md.template"), .{ | 62 | try stream.print(@embedFile("example/README.md.template"), .{ |
| 63 | @embedFile("example/simple.zig"), | 63 | @embedFile("example/simple.zig"), |
| 64 | @embedFile("example/simple-error.zig"), | 64 | @embedFile("example/simple-error.zig"), |