Skip to content

Commit 67a0aa5

Browse files
committed
[ResultBuilder] Remove buildLimitedAvailability
1 parent d8d73ea commit 67a0aa5

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

Sources/Grape/Contents/GraphContentBuilder.swift

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
public struct GraphContentBuilder<NodeID: Hashable> {
33

44
public typealias Content = GraphContent<NodeID>
5+
56
@inlinable
67
public static func buildPartialBlock<T: GraphContent>(first content: T) -> T
78
where T.NodeID == NodeID {
@@ -18,44 +19,6 @@ public struct GraphContentBuilder<NodeID: Hashable> {
1819
return _EmptyGraphContent()
1920
}
2021

21-
/// Creates a list of graph contents from a for-loop.
22-
///
23-
/// **Known issue**:
24-
/// Type inference fails when the nested element is decorated with a modifier.
25-
///
26-
/// **Workaround**:
27-
/// - Use `ForEach` like in SwiftUI. This is the recommended way.
28-
/// - Or create a you nested component comforming to `GraphComponent`,
29-
/// and use this in your loop body, like the example below
30-
///
31-
/// example:
32-
/// ```swift
33-
/// struct MyComponent: GraphComponent {
34-
/// let i: Int
35-
/// init(_ i: Int) {
36-
/// self.i = i
37-
/// }
38-
/// var body: some GraphContent<Int> {
39-
/// NodeMark(id: i)
40-
/// .opacity(0.4)
41-
/// }
42-
/// }
43-
/// ```
44-
/// Then use your component like this:
45-
/// ```swift
46-
/// let myGraph = buildGraph {
47-
/// for i in 0..<10 {
48-
/// MyComponent(i)
49-
/// }
50-
/// }
51-
@available(*, deprecated, message: "Use `Series` instead. ")
52-
@inlinable
53-
public static func buildArray<T>(_ components: [T]) -> some Content
54-
where T: Content, T.NodeID == NodeID {
55-
return _ArrayGraphContent(components)
56-
}
57-
58-
// Opaque breaks type inference?
5922
@inlinable
6023
public static func buildEither<T1, T2>(first component: T1) -> _ConditionalGraphContent<T1, T2>
6124
where T1: Content, T1.NodeID == NodeID, T2: Content, T2.NodeID == NodeID {
@@ -68,12 +31,6 @@ public struct GraphContentBuilder<NodeID: Hashable> {
6831
return _ConditionalGraphContent<T1, T2>(.falseContent(component))
6932
}
7033

71-
@inlinable
72-
public static func buildLimitedAvailability<T>(_ component: T?) -> some Content
73-
where T: Content, T.NodeID == NodeID {
74-
return _OptionalGraphContent(component)
75-
}
76-
7734
@inlinable
7835
public static func buildIf<T>(_ component: T?) -> some Content
7936
where T: Content, T.NodeID == NodeID {

0 commit comments

Comments
 (0)