Skip to content

Commit f5a41f8

Browse files
committed
update mongodb dependency
1 parent 217e470 commit f5a41f8

File tree

68 files changed

+382
-415
lines changed

Some content is hidden

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

68 files changed

+382
-415
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ let package:Package = .init(
9898

9999
.package(url: "https://github.com/tayloraswift/swift-hash", .upToNextMinor(
100100
from: "0.5.0")),
101-
.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
102-
from: "0.11.0")),
101+
//.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
102+
// from: "0.11.0")),
103+
.package(url: "https://github.com/tayloraswift/swift-mongodb", branch: "0.12"),
103104
.package(url: "https://github.com/tayloraswift/swift-png", .upToNextMinor(
104105
from: "4.2.0")),
105106

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.init(slice: payload[...]))
28+
bson: BSON.Document.init(bytes: 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension Swiftinit.GraphStorageEndpoint:BlockingEndpoint
2525
{
2626
case .put:
2727
var snapshot:Unidoc.Snapshot = try .init(
28-
bson: BSON.DocumentView.init(slice: payload[...]))
28+
bson: BSON.Document.init(bytes: payload[...]))
2929

3030
if let bucket:AWS.S3.Bucket = server.bucket,
3131
let bson:ArraySlice<UInt8> = snapshot.move()

Sources/SymbolGraphTests/Main.Availabilities.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ extension Main.Availabilities:TestBattery
2323
tests.do
2424
{
2525
let bson:BSON.Document = .init(encoding: availability)
26-
27-
let decoded:Availability = try .init(bson: BSON.DocumentView.init(bson))
26+
let decoded:Availability = try .init(bson: bson)
2827

2928
tests.expect(availability ==? decoded)
3029
}
@@ -42,8 +41,7 @@ extension Main.Availabilities:TestBattery
4241
tests.do
4342
{
4443
let bson:BSON.Document = .init(encoding: availability)
45-
let decoded:Availability = try .init(
46-
bson: BSON.DocumentView.init(bson))
44+
let decoded:Availability = try .init(bson: bson)
4745

4846
tests.expect(availability ==? decoded)
4947
}
@@ -64,8 +62,7 @@ extension Main.Availabilities:TestBattery
6462
tests.do
6563
{
6664
let bson:BSON.Document = .init(encoding: availability)
67-
let decoded:Availability = try .init(
68-
bson: BSON.DocumentView.init(bson))
65+
let decoded:Availability = try .init(bson: bson)
6966

7067
tests.expect(availability ==? decoded)
7168
}

Sources/SymbolGraphTests/Main.Dependencies.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ extension Main.Dependencies:TestBattery
4040
tests.do
4141
{
4242
let encoded:BSON.Document = .init(encoding: value)
43-
let decoded:SymbolGraphMetadata.Dependency = try .init(
44-
bson: BSON.DocumentView.init(encoded))
43+
let decoded:SymbolGraphMetadata.Dependency = try .init(bson: encoded)
4544

4645
tests.expect(value ==? decoded)
4746
}

Sources/SymbolGraphTests/Main.Generics.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ extension Main.Generics:TestBattery
2828
tests.do
2929
{
3030
let bson:BSON.List = .init(elements: parameters)
31-
let decoded:[GenericParameter] = try .init(
32-
bson: BSON.ListView.init(bson))
31+
let decoded:[GenericParameter] = try .init(bson: bson)
3332

3433
tests.expect(parameters ..? decoded)
3534
}
@@ -50,7 +49,8 @@ extension Main.Generics:TestBattery
5049

5150
for what:GenericOperator in [.conformer, .subclass, .equal]
5251
{
53-
guard let tests:TestGroup = tests / "\(what)"
52+
guard
53+
let tests:TestGroup = tests / "\(what)"
5454
else
5555
{
5656
continue
@@ -63,9 +63,7 @@ extension Main.Generics:TestBattery
6363
tests.do
6464
{
6565
let bson:BSON.Document = .init(encoding: constraint)
66-
67-
let decoded:GenericConstraint<Int32> = try .init(
68-
bson: BSON.DocumentView.init(bson))
66+
let decoded:GenericConstraint<Int32> = try .init(bson: bson)
6967

7068
tests.expect(constraint ==? decoded)
7169
}

Sources/SymbolGraphs/Articles/MarkdownBytecode (ext).swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ extension MarkdownBytecode:BSONEncodable
66
public
77
func encode(to field:inout BSON.FieldEncoder)
88
{
9-
let view:BSON.BinaryView<[UInt8]> = .init(subtype: .generic, slice: self.bytes)
9+
let view:BSON.BinaryView<[UInt8]> = .init(subtype: .generic, bytes: self.bytes)
1010
view.encode(to: &field)
1111
}
1212
}
1313
extension MarkdownBytecode:BSONDecodable, BSONBinaryViewDecodable
1414
{
1515
@inlinable public
16-
init(bson:BSON.BinaryView<some RandomAccessCollection<UInt8>>) throws
16+
init(bson:BSON.BinaryView<ArraySlice<UInt8>>) throws
1717
{
18-
self.init(bytes: [UInt8].init(bson.slice))
18+
self.init(bytes: [UInt8].init(bson.bytes))
1919
}
2020
}

Sources/SymbolGraphs/Buffers/SymbolGraph.Buffer.swift

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension SymbolGraph.Buffer:BSONEncodable
4040
@usableFromInline internal
4141
func encode(to field:inout BSON.FieldEncoder)
4242
{
43-
let bson:BSON.BinaryView<[UInt8]> = .init(subtype: .generic, slice: .init(
43+
let bson:BSON.BinaryView<[UInt8]> = .init(subtype: .generic, bytes: .init(
4444
unsafeUninitializedCapacity: self.elements.count * 3)
4545
{
4646
for (i, scalar):(Int, Int32) in self.elements.enumerated()
@@ -59,21 +59,14 @@ extension SymbolGraph.Buffer:BSONEncodable
5959
extension SymbolGraph.Buffer:BSONBinaryViewDecodable
6060
{
6161
@inlinable internal
62-
init<Bytes>(bson:BSON.BinaryView<Bytes>) throws
62+
init(bson:BSON.BinaryView<ArraySlice<UInt8>>) throws
6363
{
64-
if let buffer:Self =
65-
try bson.slice.withContiguousStorageIfAvailable(Self.init(bytes:))
66-
{
67-
self = buffer
68-
}
69-
else
70-
{
71-
try self.init(bytes: bson.slice)
72-
}
64+
self = try bson.bytes.withUnsafeBytes(Self.init(bytes:))
7365
}
7466

67+
/// Is there even a measurable benefit from using `UnsafeRawBufferPointer` here?
7568
@inlinable internal
76-
init<Bytes>(bytes compact:Bytes) throws where Bytes:RandomAccessCollection<UInt8>
69+
init(bytes compact:UnsafeRawBufferPointer) throws
7770
{
7871
guard compact.startIndex < compact.endIndex
7972
else
@@ -90,11 +83,11 @@ extension SymbolGraph.Buffer:BSONBinaryViewDecodable
9083

9184
self.init(.init(unsafeUninitializedCapacity: count)
9285
{
93-
var a:Bytes.Index = compact.startIndex
86+
var a:Int = compact.startIndex
9487
for i:Int in 0 ..< count
9588
{
96-
let b:Bytes.Index = compact.index(after: a)
97-
let c:Bytes.Index = compact.index(after: b)
89+
let b:Int = compact.index(after: a)
90+
let c:Int = compact.index(after: b)
9891
defer
9992
{
10093
a = compact.index(after: c)

Sources/SymbolGraphs/Declarations/Availability.Clauses (ext).swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extension Availability.Clauses
1414
case message = "M"
1515
}
1616
}
17-
extension Availability.Clauses:BSONDocumentDecodable, BSONDocumentViewDecodable, BSONDecodable
17+
extension Availability.Clauses:BSONDocumentDecodable, BSONDecodable
1818
where Domain.Unavailability:BSONDecodable,
1919
Domain.Deprecation:BSONDecodable,
2020
Domain.Bound:BSONDecodable

0 commit comments

Comments
 (0)