Refactored out Clean

This commit is contained in:
Luuk Machielse 2025-10-10 20:11:05 +02:00
parent 6122ca7b19
commit 2f02e13cc3

View file

@ -149,11 +149,11 @@ pub fn Iterator(comptime Inner: type) type {
}.some);
}
pub fn chain(self: Self, other: anytype) Iterator(adapters.Chain(Inner, Clean(@TypeOf(other)))) {
pub fn chain(self: Self, other: anytype) Iterator(adapters.Chain(Inner, @TypeOf(other)._Inner)) {
return .{ .inner = .{ .first = self.inner, .second = other.inner } };
}
pub fn zip(self: Self, other: anytype) Iterator(adapters.Zip(Inner, Clean(@TypeOf(other)))) {
pub fn zip(self: Self, other: anytype) Iterator(adapters.Zip(Inner, @TypeOf(other)._Inner)) {
return .{ .inner = .{ .a = self.inner, .b = other.inner } };
}
@ -175,14 +175,6 @@ pub fn Iterator(comptime Inner: type) type {
};
}
fn Clean(comptime It: type) type {
if (@hasDecl(It, "_Inner")) {
if (Iterator(It._Inner) == It) return It._Inner;
}
return It;
}
pub const adapters = struct {
pub fn Map(
comptime Inner: type,