fn formatVersion(version: SemanticVersion, gpa: Allocator, list: *ArrayList(u8)) !void
Formats a version with the patch component omitted if it is zero, unlike SemanticVersion.format which formats all its version components regardless.
version: SemanticVersion
gpa: Allocator
list: *ArrayList(u8)
413 414 415 416 417 418 419
fn formatVersion(version: SemanticVersion, gpa: Allocator, list: *ArrayList(u8)) !void { if (version.patch == 0) { try list.print(gpa, "{d}.{d}", .{ version.major, version.minor }); } else { try list.print(gpa, "{d}.{d}.{d}", .{ version.major, version.minor, version.patch }); } }
Formats a version with the patch component omitted if it is zero, unlike SemanticVersion.format which formats all its version components regardless.