Use approachable concurrency with RSTree.

This commit is contained in:
Brent Simmons committed 2025-11-10 13:29:50 -08:00
1 parent 1b2e2d0513
commit 83df10d8cf
10 files changed
+21 -15

No files matched your search

+5 -1
View File
@@ -22,7 +22,11 @@
"Bash(dd:*)",
"Bash(xcrun simctl list:*)",
"Bash(timeout 600 ./buildscripts/quiet_build_and_test.sh:*)",
"Bash(mkdir:*)"
"Bash(mkdir:*)",
"WebFetch(domain:www.donnywals.com)",
"WebFetch(domain:mjtsai.com)",
"WebFetch(domain:www.massicotte.org)",
"WebFetch(domain:www.hackingwithswift.com)"
],
"deny": []
}
@@ -889,7 +889,7 @@ private extension SidebarViewController {
}
private extension Node {
@MainActor private extension Node {
func representsSidebarObject(_ object: AnyObject) -> Bool {
if representedObject === object {
@@ -24,7 +24,7 @@ public struct FeedSpecifier: Hashable, Sendable {
public let source: Source
public let orderFound: Int
public var score: Int {
return calculatedScore()
calculatedScore()
}
public init(title: String?, urlString: String, source: Source, orderFound: Int) {
+6 -1
View File
@@ -13,6 +13,11 @@ let package = Package(
targets: [
.target(
name: "RSTree",
dependencies: []),
dependencies: [],
swiftSettings: [
.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
.enableUpcomingFeature("InferIsolatedConformances"),
.defaultIsolation(MainActor.self)
]),
]
)
+2 -3
View File
@@ -10,7 +10,7 @@ import Foundation
// Main thread only.
@MainActor public final class Node: Hashable {
public final class Node: Hashable {
public weak var parent: Node?
public let representedObject: AnyObject
@@ -185,8 +185,7 @@ import Foundation
public extension Array where Element == Node {
@MainActor func representedObjects() -> [AnyObject] {
func representedObjects() -> [AnyObject] {
return self.map{ $0.representedObject }
}
}
+1 -2
View File
@@ -8,8 +8,7 @@
import Foundation
@MainActor public struct NodePath {
public struct NodePath {
let components: [Node]
public init(node: Node) {
@@ -8,14 +8,13 @@
import Foundation
@MainActor public protocol TreeControllerDelegate: AnyObject {
public protocol TreeControllerDelegate: AnyObject {
func treeController(treeController: TreeController, childNodesFor: Node) -> [Node]?
}
public typealias NodeVisitBlock = (_ : Node) -> Void
@MainActor public final class TreeController {
public final class TreeController {
private weak var delegate: TreeControllerDelegate?
public let rootNode: Node
+1 -1
View File
@@ -222,7 +222,7 @@ private struct SidebarItemSpecifier {
}
private extension Node {
@MainActor private extension Node {
func parentFolder() -> Folder? {
+1 -1
View File
@@ -24,7 +24,7 @@ import RSCore
}
}
private extension Node {
@MainActor private extension Node {
class func nodesSortedAlphabetically(_ nodes: [Node]) -> [Node] {
@@ -20,7 +20,7 @@ final class FolderTreeControllerDelegate: TreeControllerDelegate {
}
}
private extension FolderTreeControllerDelegate {
@MainActor private extension FolderTreeControllerDelegate {
func childNodesForRootNode(_ node: Node) -> [Node]? {