Files
bun.sh/src/install/versioned_url.zig
pfg 83760fc446 Sort imports in all files (#21119)
Co-authored-by: taylor.fish <contact@taylor.fish>
2025-07-21 13:26:47 -07:00

30 lines
1001 B
Zig

pub const VersionedURL = extern struct {
url: String,
version: Semver.Version,
pub fn eql(this: VersionedURL, other: VersionedURL) bool {
return this.version.eql(other.version);
}
pub fn order(this: VersionedURL, other: VersionedURL, lhs_buf: []const u8, rhs_buf: []const u8) @import("std").math.Order {
return this.version.order(other.version, lhs_buf, rhs_buf);
}
pub fn count(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) void {
this.version.count(buf, comptime Builder, builder);
builder.count(this.url.slice(buf));
}
pub fn clone(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) VersionedURL {
return VersionedURL{
.version = this.version.append(buf, Builder, builder),
.url = builder.append(String, this.url.slice(buf)),
};
}
};
const bun = @import("bun");
const Semver = bun.Semver;
const String = Semver.String;