Skip to content

Commit

Permalink
Make builder methods public
Browse files Browse the repository at this point in the history
  • Loading branch information
xtyxtyx committed Jan 23, 2025
1 parent 7539e22 commit 788f358
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Sources/Shaft/Widgets/Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
/// A resultBuilder that builds a single widget.
@resultBuilder
public struct WidgetBuilder {
static public func buildBlock(_ components: Widget...) -> Widget {
public static func buildBlock(_ components: Widget...) -> Widget {
assert(components.count == 1)
return components[0]
}

static func buildEither(first component: Widget) -> Widget {
public static func buildEither(first component: Widget) -> Widget {
return component
}

static func buildEither(second component: Widget) -> Widget {
public static func buildEither(second component: Widget) -> Widget {
return component
}

Expand All @@ -30,7 +30,7 @@ public struct WidgetBuilder {
// return WidgetGroup(components: components)
// }

static func buildExpression(_ expression: Widget) -> Widget {
public static func buildExpression(_ expression: Widget) -> Widget {
return expression
}

Expand All @@ -45,7 +45,7 @@ public struct WidgetBuilder {

@resultBuilder
public struct OptionalWidgetBuilder {
static public func buildBlock(_ components: Widget?...) -> Widget? {
public static func buildBlock(_ components: Widget?...) -> Widget? {
if components.count == 0 {
return nil
} else {
Expand All @@ -54,23 +54,23 @@ public struct OptionalWidgetBuilder {
}
}

static func buildEither(first component: Widget?) -> Widget? {
public static func buildEither(first component: Widget?) -> Widget? {
return component
}

static func buildEither(second component: Widget?) -> Widget? {
public static func buildEither(second component: Widget?) -> Widget? {
return component
}

static func buildOptional(_ component: Widget?) -> Widget? {
public static func buildOptional(_ component: Widget?) -> Widget? {
return component
}

// static func buildArray(_ components: [Widget]) -> Widget? {
// return WidgetGroup(components: components)
// }

static func buildExpression(_ expression: Widget?) -> Widget? {
public static func buildExpression(_ expression: Widget?) -> Widget? {
return expression
}

Expand Down

0 comments on commit 788f358

Please sign in to comment.