Skip to content

Commit a8112c0

Browse files
committed
remove temporary hack :)
1 parent 875408d commit a8112c0

File tree

2 files changed

+7
-36
lines changed

2 files changed

+7
-36
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<strong><em><code>unidoc</code></em></strong><br><small><code>0.2.4</code></small>
3+
<strong><em><code>unidoc</code></em></strong><br><small><code>0.2.5</code></small>
44

55
[![ci build status](https://github.com/kelvin13/swift-unidoc/actions/workflows/build.yml/badge.svg)](https://github.com/kelvin13/swift-unidoc/actions/workflows/build.yml)
66

Sources/UnidocDB/Packages/PackageEdition.swift

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,16 @@ struct PackageEdition:Identifiable, Equatable, Sendable
3232

3333
@inlinable public
3434
init(id:Unidoc.Zone,
35-
release:Bool?,
36-
patch:PatchVersion?,
35+
release:Bool,
36+
patch:PatchVersion,
3737
name:String,
3838
sha1:SHA1?,
3939
lost:Bool = false)
4040
{
4141
self.id = id
4242

43-
// Temporary HACK until we can migrate all the database records.
44-
self.release = release ?? true
45-
if let patch:PatchVersion
46-
{
47-
self.patch = patch
48-
}
49-
else if name == "swift-5.8.1-RELEASE"
50-
{
51-
self.patch = .v(5, 8, 1)
52-
}
53-
else if name == "swift-5.9-RELEASE"
54-
{
55-
self.patch = .v(5, 9, 0)
56-
}
57-
else
58-
{
59-
switch SemanticVersion.init(refname: name)
60-
{
61-
case .release(let version, build: _)?:
62-
self.release = true
63-
self.patch = version
64-
65-
case .prerelease(let version, _, build: _)?:
66-
self.release = false
67-
self.patch = version
68-
69-
case nil:
70-
fatalError("can’t infer patch version from refname: \(name)")
71-
}
72-
}
73-
// End temporary HACK.
43+
self.release = release
44+
self.patch = patch
7445

7546
self.name = name
7647
self.sha1 = sha1
@@ -126,8 +97,8 @@ extension PackageEdition:BSONDocumentDecodable
12697
init(bson:BSON.DocumentDecoder<CodingKey, some RandomAccessCollection<UInt8>>) throws
12798
{
12899
self.init(id: try bson[.id].decode(),
129-
release: try bson[.release]?.decode(),
130-
patch: try bson[.patch]?.decode(),
100+
release: try bson[.release].decode(),
101+
patch: try bson[.patch].decode(),
131102
name: try bson[.name].decode(),
132103
sha1: try bson[.sha1]?.decode(),
133104
lost: try bson[.lost]?.decode() ?? false)

0 commit comments

Comments
 (0)