Skip to content

Commit 217e470

Browse files
committed
naïvely update to mongodb 0.11 and the simplified BSON api
1 parent cfa8ace commit 217e470

File tree

90 files changed

+107
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+107
-112
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ let package:Package = .init(
9999
.package(url: "https://github.com/tayloraswift/swift-hash", .upToNextMinor(
100100
from: "0.5.0")),
101101
.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
102-
from: "0.10.8")),
102+
from: "0.11.0")),
103103
.package(url: "https://github.com/tayloraswift/swift-png", .upToNextMinor(
104104
from: "4.2.0")),
105105

Sources/HTTPClient/HTTP2/HTTP2Client.Connection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extension HTTP2Client.Connection
4444
}
4545

4646
@inlinable public
47-
func buffer(bytes:[UInt8]) -> ByteBuffer
47+
func buffer(bytes:ArraySlice<UInt8>) -> ByteBuffer
4848
{
4949
self.channel.allocator.buffer(bytes: bytes)
5050
}

Sources/SwiftinitServer/Endpoints/Procedural/Swiftinit.GraphPlacementEndpoint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension Swiftinit.GraphPlacementEndpoint:BlockingEndpoint
2525
{
2626
case .put:
2727
let docs:SymbolGraphObject<Void> = try .init(
28-
bson: BSON.DocumentView<[UInt8]>.init(slice: payload))
28+
bson: BSON.DocumentView.init(slice: payload[...]))
2929

3030
let uploaded:Unidoc.UploadStatus = try await server.db.unidoc.store(
3131
docs: consume docs,

Sources/SwiftinitServer/Endpoints/Procedural/Swiftinit.GraphStorageEndpoint.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ extension Swiftinit.GraphStorageEndpoint:BlockingEndpoint
2525
{
2626
case .put:
2727
var snapshot:Unidoc.Snapshot = try .init(
28-
bson: BSON.DocumentView<[UInt8]>.init(slice: payload))
28+
bson: BSON.DocumentView.init(slice: payload[...]))
2929

3030
if let bucket:AWS.S3.Bucket = server.bucket,
31-
let bson:[UInt8] = snapshot.move()
31+
let bson:ArraySlice<UInt8> = snapshot.move()
3232
{
3333
var deflator:LZ77.Deflator = .init(format: .zlib,
3434
level: 7,
3535
hint: 128 << 10)
3636

37-
deflator.push((consume bson)[...], last: true)
37+
deflator.push(consume bson, last: true)
3838

3939
var bson:[UInt8] = []
4040
while let part:[UInt8] = deflator.pull()

Sources/SwiftinitServer/Plugins/Swiftinit.GraphLoader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extension Swiftinit
2020
}
2121
extension Swiftinit.GraphLoader:Unidoc.GraphLoader
2222
{
23-
func load(graph:Unidoc.GraphPath) async throws -> [UInt8]
23+
func load(graph:Unidoc.GraphPath) async throws -> ArraySlice<UInt8>
2424
{
2525
var bytes:[UInt8] = try await self.s3.get(path: "\(graph)")
2626

@@ -35,6 +35,6 @@ extension Swiftinit.GraphLoader:Unidoc.GraphLoader
3535
bytes = inflator.pull()
3636
}
3737

38-
return bytes
38+
return bytes[...]
3939
}
4040
}

Sources/SymbolGraphTests/Main.Availabilities.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ extension Main.Availabilities:TestBattery
2424
{
2525
let bson:BSON.Document = .init(encoding: availability)
2626

27-
let decoded:Availability = try .init(
28-
bson: BSON.DocumentView<[UInt8]>.init(bson))
27+
let decoded:Availability = try .init(bson: BSON.DocumentView.init(bson))
2928

3029
tests.expect(availability ==? decoded)
3130
}
@@ -44,7 +43,7 @@ extension Main.Availabilities:TestBattery
4443
{
4544
let bson:BSON.Document = .init(encoding: availability)
4645
let decoded:Availability = try .init(
47-
bson: BSON.DocumentView<[UInt8]>.init(bson))
46+
bson: BSON.DocumentView.init(bson))
4847

4948
tests.expect(availability ==? decoded)
5049
}
@@ -66,7 +65,7 @@ extension Main.Availabilities:TestBattery
6665
{
6766
let bson:BSON.Document = .init(encoding: availability)
6867
let decoded:Availability = try .init(
69-
bson: BSON.DocumentView<[UInt8]>.init(bson))
68+
bson: BSON.DocumentView.init(bson))
7069

7170
tests.expect(availability ==? decoded)
7271
}

Sources/SymbolGraphTests/Main.Dependencies.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extension Main.Dependencies:TestBattery
4141
{
4242
let encoded:BSON.Document = .init(encoding: value)
4343
let decoded:SymbolGraphMetadata.Dependency = try .init(
44-
bson: BSON.DocumentView<[UInt8]>.init(encoded))
44+
bson: BSON.DocumentView.init(encoded))
4545

4646
tests.expect(value ==? decoded)
4747
}

Sources/SymbolGraphTests/Main.Generics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension Main.Generics:TestBattery
2929
{
3030
let bson:BSON.List = .init(elements: parameters)
3131
let decoded:[GenericParameter] = try .init(
32-
bson: BSON.ListView<[UInt8]>.init(bson))
32+
bson: BSON.ListView.init(bson))
3333

3434
tests.expect(parameters ..? decoded)
3535
}
@@ -65,7 +65,7 @@ extension Main.Generics:TestBattery
6565
let bson:BSON.Document = .init(encoding: constraint)
6666

6767
let decoded:GenericConstraint<Int32> = try .init(
68-
bson: BSON.DocumentView<[UInt8]>.init(bson))
68+
bson: BSON.DocumentView.init(bson))
6969

7070
tests.expect(constraint ==? decoded)
7171
}

Sources/SymbolGraphs/Articles/SymbolGraph.Article.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ extension SymbolGraph.Article:BSONDocumentEncodable
6868
extension SymbolGraph.Article:BSONDocumentDecodable
6969
{
7070
@inlinable public
71-
init(bson:BSON.DocumentDecoder<CodingKey, some RandomAccessCollection<UInt8>>) throws
71+
init(bson:BSON.DocumentDecoder<CodingKey>) throws
7272
{
7373
self.init(
7474
outlines: try bson[.outlines]?.decode() ?? [],

0 commit comments

Comments
 (0)