Skip to content

Commit aaf6057

Browse files
authored
Add CustomReflectable conformances (#191)
Prevents leaking any of the guts of a shared value.
1 parent 530c98a commit aaf6057

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Sources/Sharing/Shared.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@ public struct Shared<Value> {
412412
}
413413
}
414414

415+
extension Shared: CustomReflectable {
416+
public var customMirror: Mirror {
417+
Mirror(reflecting: wrappedValue)
418+
}
419+
}
420+
415421
extension Shared: CustomStringConvertible {
416422
public var description: String {
417423
"\(typeName(Self.self, genericsAbbreviated: false))(\(reference.description))"

Sources/Sharing/SharedReader.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ public struct SharedReader<Value> {
301301
}
302302
}
303303

304+
extension SharedReader: CustomReflectable {
305+
public var customMirror: Mirror {
306+
Mirror(reflecting: wrappedValue)
307+
}
308+
}
309+
304310
extension SharedReader: CustomStringConvertible {
305311
public var description: String {
306312
"\(typeName(Self.self, genericsAbbreviated: false))(\(reference.description))"

0 commit comments

Comments
 (0)