@@ -145,6 +145,7 @@ extension SharedReader {
145145 }
146146
147147 // TODO: Non-async version of 'init(require:)'?
148+ // TODO: Chopping block for 2.0?
148149
149150 /// Creates a shared reference to a read-only value using a shared key.
150151 ///
@@ -154,11 +155,7 @@ extension SharedReader {
154155 /// - Parameter key: A shared key associated with the shared reference. It is responsible for
155156 /// loading and saving the shared reference's value from some external source.
156157 public init ( require key: some SharedReaderKey < Value > ) async throws {
157- let value = try await withUnsafeThrowingContinuation { continuation in
158- key. load ( initialValue: nil ) { result in
159- continuation. resume ( with: result)
160- }
161- }
158+ let value = try await key. load ( initialValue: nil )
162159 guard let value else { throw LoadError ( ) }
163160 self . init ( rethrowing: value, key)
164161 if let loadError { throw loadError }
@@ -167,11 +164,7 @@ extension SharedReader {
167164 @_disfavoredOverload
168165 @_documentation ( visibility: private)
169166 public init ( require key: some SharedKey < Value > ) async throws {
170- let value = try await withUnsafeThrowingContinuation { continuation in
171- key. load ( initialValue: nil ) { result in
172- continuation. resume ( with: result)
173- }
174- }
167+ let value = try await key. load ( initialValue: nil )
175168 guard let value else { throw LoadError ( ) }
176169 self . init ( rethrowing: value, key)
177170 if let loadError { throw loadError }
0 commit comments