diff --git a/src/common.zig b/src/common.zig index eb02eb53d7a50e05e6c260dee6078b5f06ed7a8b..a51ef0d5456ce37cb1ae6d6a698ac1f2b387aef5 100644 --- a/src/common.zig +++ b/src/common.zig @@ -123,7 +123,7 @@ pub fn get_modpath(cachepath: string, d: u.Dep, options: *CollectOptions) !strin }, .git => { if (d.version.len > 0) { - const vers = u.parse_split(u.GitVersionType, "-").do(d.version) catch |e| switch (e) { + const vers = u.parse_split(u.DepType.GitVersion, "-").do(d.version) catch |e| switch (e) { error.IterEmpty => unreachable, error.NoMemberFound => { const vtype = d.version[0..std.mem.indexOf(u8, d.version, "-").?]; diff --git a/src/util/dep.zig b/src/util/dep.zig index 34298edf5e2d47ef05b023f3da5f9d70bf387f61..9a666a4dee40c55b519fc73f71a3ede78d1cdd25 100644 --- a/src/util/dep.zig +++ b/src/util/dep.zig @@ -65,7 +65,7 @@ pub const Dep = struct { } return switch (self.type) { .git => blk: { - const vers = try u.parse_split(u.GitVersionType, "-").do(self.version); + const vers = try u.parse_split(u.DepType.GitVersion, "-").do(self.version); if (vers.id.frozen()) break :blk self.version; break :blk try self.type.exact_version(dpath); }, diff --git a/src/util/dep_type.zig b/src/util/dep_type.zig index 189a90db91a456fcfb78151d6a5bbbedd756cce5..4ff949f4d37a673e5bf6a6152520e9095bee085f 100644 --- a/src/util/dep_type.zig +++ b/src/util/dep_type.zig @@ -89,18 +89,18 @@ pub const DepType = enum { .http => "", }; } -}; -pub const GitVersionType = enum { - branch, - tag, - commit, + pub const GitVersion = enum { + branch, + tag, + commit, - pub fn frozen(self: GitVersionType) bool { - return switch (self) { - .branch => false, - .tag => true, - .commit => true, - }; - } + pub fn frozen(self: GitVersion) bool { + return switch (self) { + .branch => false, + .tag => true, + .commit => true, + }; + } + }; };