Skip to content

Commit 88e76ae

Browse files
committed
Update to use Cache from 0xLeif
1 parent 27ce902 commit 88e76ae

4 files changed

Lines changed: 12 additions & 26 deletions

File tree

Package.resolved

Lines changed: 3 additions & 21 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
@@ -20,7 +20,7 @@ let package = Package(
2020
],
2121
dependencies: [
2222
// Dependencies declare other packages that this package depends on.
23-
.package(url: "https://github.com/0xOpenBytes/Cache", from: "0.1.0")
23+
.package(url: "https://github.com/0xLeif/Cache", from: "1.0.0")
2424
],
2525
targets: [
2626
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Sources/TaskManager/TaskManager.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import c
21
import Cache
32

43
/// A `TaskManager` is a cache for asynchronous tasks.
@@ -76,7 +75,10 @@ open class TaskManager<Key: Hashable>: Cache<Key, Task<Sendable, Error>> {
7675
let value = try await managedTask.value
7776

7877
guard let success = value as? Success else {
79-
throw c.InvalidTypeError(expectedType: type, actualValue: value)
78+
throw InvalidTypeError(
79+
expectedType: Success.self,
80+
actualType: Sendable.self
81+
)
8082
}
8183

8284
return success

Tests/TaskManagerTests/TaskManagerTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import t
21
import XCTest
32
@testable import TaskManager
43

@@ -32,6 +31,9 @@ final class TaskManagerTests: XCTestCase {
3231

3332
taskManager.cancel(key: .loop)
3433

35-
try await t.assertThrows(try await taskManager.wait(for: .loop))
34+
do {
35+
try await taskManager.wait(for: .loop)
36+
XCTFail()
37+
} catch { }
3638
}
3739
}

0 commit comments

Comments
 (0)