| ... | ... | @@ -1248,7 +1248,9 @@ fn computeRedraw(serialized_buffer: *Serialized.Buffer) struct { []u8, usize } { |
| 1248 | 1248 | i += progress_pulsing.len; |
| 1249 | 1249 | } else { |
| 1250 | 1250 | const percent = completed_items * 100 / estimated_total; |
| 1251 | | i += (std.fmt.bufPrint(buf[i..], @"progress_normal {d}", .{percent}) catch &.{}).len; |
| 1251 | if (std.fmt.bufPrint(buf[i..], @"progress_normal {d}", .{percent})) |b| { |
| 1252 | i += b.len; |
| 1253 | } else |_| {} |
| 1252 | 1254 | } |
| 1253 | 1255 | }, |
| 1254 | 1256 | .success => { |
| ... | ... | @@ -1265,7 +1267,9 @@ fn computeRedraw(serialized_buffer: *Serialized.Buffer) struct { []u8, usize } { |
| 1265 | 1267 | i += progress_pulsing_error.len; |
| 1266 | 1268 | } else { |
| 1267 | 1269 | const percent = completed_items * 100 / estimated_total; |
| 1268 | | i += (std.fmt.bufPrint(buf[i..], @"progress_error {d}", .{percent}) catch &.{}).len; |
| 1270 | if (std.fmt.bufPrint(buf[i..], @"progress_error {d}", .{percent})) |b| { |
| 1271 | i += b.len; |
| 1272 | } else |_| {} |
| 1269 | 1273 | } |
| 1270 | 1274 | }, |
| 1271 | 1275 | } |
| ... | ... | @@ -1364,12 +1368,18 @@ fn computeNode( |
| 1364 | 1368 | if (!is_empty_root) { |
| 1365 | 1369 | if (name.len != 0 or estimated_total > 0) { |
| 1366 | 1370 | if (estimated_total > 0) { |
| 1367 | | i += (std.fmt.bufPrint(buf[i..], "[{d}/{d}] ", .{ completed_items, estimated_total }) catch &.{}).len; |
| 1371 | if (std.fmt.bufPrint(buf[i..], "[{d}/{d}] ", .{ completed_items, estimated_total })) |b| { |
| 1372 | i += b.len; |
| 1373 | } else |_| {} |
| 1368 | 1374 | } else if (completed_items != 0) { |
| 1369 | | i += (std.fmt.bufPrint(buf[i..], "[{d}] ", .{completed_items}) catch &.{}).len; |
| 1375 | if (std.fmt.bufPrint(buf[i..], "[{d}] ", .{completed_items})) |b| { |
| 1376 | i += b.len; |
| 1377 | } else |_| {} |
| 1370 | 1378 | } |
| 1371 | 1379 | if (name.len != 0) { |
| 1372 | | i += (std.fmt.bufPrint(buf[i..], "{s}", .{name}) catch &.{}).len; |
| 1380 | if (std.fmt.bufPrint(buf[i..], "{s}", .{name})) |b| { |
| 1381 | i += b.len; |
| 1382 | } else |_| {} |
| 1373 | 1383 | } |
| 1374 | 1384 | } |
| 1375 | 1385 | |