authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:25:00 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:25:00 -08:00
log6ebab3dab47268e28599ac396e785f8a76acc7b6
tree2b16d8d2cc7e14a09b1c9cb2994c14d464809bc0
parentcb7f0d0d5d65b7ea9304aea232bb2f5383f0356a

vendor nektro/zig-range


2 files changed, 11 insertions(+), 3 deletions(-)

src/lib.zig+11-1
......@@ -2,7 +2,17 @@ const std = @import("std");
22const string = []const u8;
33const assert = std.debug.assert;
44
5pub const range = @import("range").range;
5/// Use this as a way to increment an index using a for loop. Works with both
6/// runtime and comptime integers.
7///
8/// ```zig
9/// for (range(10)) |_, i| {
10/// // 'i' will increment from 0 -> 9
11/// }
12/// ```
13pub fn range(len: usize) []const void {
14 return @as([*]void, undefined)[0..len];
15}
616
717pub fn fmtByteCountIEC(alloc: std.mem.Allocator, b: u64) !string {
818 return try reduceNumber(alloc, b, 1024, "B", "KMGTPEZYRQ");
zig.mod-2
......@@ -4,5 +4,3 @@ main: src/lib.zig
44license: MIT
55description: An assortment of random utility functions that aren't in std and don't deserve their own pacakge.
66min_zig_version: 0.10.0-dev.3017+da94227f7
7dependencies:
8 - src: git https://github.com/nektro/zig-range