Zig utility library
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add AngelType and remove `take` from SliceIterator since it can be simply done using the underlying slice.

IamPyu e8a1607b 99b80c2f

+6 -14
-13
src/SliceIterator.zig
··· 61 61 62 62 return item; 63 63 } 64 - 65 - /// Returns another iterator that contains the elements of the slice in the range `begin`..`end` 66 - pub fn take(self: *const Self, begin: usize, end: usize) Self { 67 - return Self.init(self.slice[begin..end]); 68 - } 69 64 }; 70 65 } 71 66 ··· 84 79 85 80 const item = iter.peek().?; 86 81 try std.testing.expectEqual(1, item); 87 - } 88 - 89 - test "take" { 90 - const array = [_]i32{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 91 - var iter = SliceIterator(i32).init(&array); 92 - 93 - var take = iter.take(3, 6); 94 - try std.testing.expectEqual(4, take.next().?); 95 82 } 96 83 97 84 test "count" {
+6 -1
src/math.zig
··· 7 7 const vec = la.vec; 8 8 const mat = la.mat; 9 9 10 + pub const AngleType = enum { 11 + Rad, 12 + Deg, 13 + }; 14 + 10 15 pub fn Angle(comptime T: type) type { 11 - return union(enum) { 16 + return union(AngleType) { 12 17 const Self = @This(); 13 18 14 19 Rad: T,