Skip to content

Commit b5694ac

Browse files
authored
Make sure events are borrowed when snapshotting. (#170)
`Event.Snapshot.init(snapshotting:)` needs to borrow its argument (since we want to explicitly avoid copying `Event` instances.)
1 parent c8c1110 commit b5694ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Testing/Events/Event.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ extension Event {
278278

279279
/// Snapshots an ``Event``.
280280
/// - Parameter event: The original ``Event`` to snapshot.
281-
public init(snapshotting event: Event) {
281+
public init(snapshotting event: borrowing Event) {
282282
kind = Event.Kind.Snapshot(snapshotting: event.kind)
283283
testID = event.testID
284284
instant = event.instant

0 commit comments

Comments
 (0)