Skip to content

Commit

Permalink
Update for latest Zig check for unnecessary use of var (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
moderation authored Nov 21, 2023
1 parent 00b158c commit 4c1f00a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ fn printUnit(w: anytype, x: f64, unit: Measurement.Unit, std_dev: f64, color_ena
_ = std_dev; // TODO something useful with this
const num = x;
var val: f64 = 0;
var color: []const u8 = progress.EscapeCodes.dim ++ progress.EscapeCodes.white;
const color: []const u8 = progress.EscapeCodes.dim ++ progress.EscapeCodes.white;
var ustr: []const u8 = " ";
if (num >= 1000_000_000_000) {
val = num / 1000_000_000_000;
Expand Down
2 changes: 1 addition & 1 deletion src/progress.zig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub const ProgressBar = struct {

pub fn init(allocator: std.mem.Allocator, stdout: std.fs.File) !Self {
const width = getScreenWidth(stdout.handle);
var buf = try std.ArrayList(u8).initCapacity(allocator, width + WIDTH_PADDING);
const buf = try std.ArrayList(u8).initCapacity(allocator, width + WIDTH_PADDING);
return Self{
.spinner = Spinner.init(),
.last_rendered = try std.time.Instant.now(),
Expand Down

0 comments on commit 4c1f00a

Please sign in to comment.