Skip to content

Commit

Permalink
moar public
Browse files Browse the repository at this point in the history
  • Loading branch information
griotspeak committed Apr 3, 2024
1 parent b14c36b commit 7133246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/DiscriminatedUnion/DiscriminatedUnion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ public protocol DiscriminatedUnion {
public protocol DiscriminantType: Hashable, Equatable, CaseIterable {}

extension DiscriminatedUnion {
static func randomDiscriminant<G: RandomNumberGenerator>(
public static func randomDiscriminant<G: RandomNumberGenerator>(
using generator: inout G
) -> Self.Discriminant {
Discriminant.random(using: &generator)
}
}

extension DiscriminantType {
static func random<G: RandomNumberGenerator>(using generator: inout G) -> Self {
public static func random<G: RandomNumberGenerator>(using generator: inout G) -> Self {
Self.allCases.randomElement(using: &generator)!
}

static func random() -> Self {
public static func random() -> Self {
var g = SystemRandomNumberGenerator()
return Self.random(using: &g)
}
Expand Down

0 comments on commit 7133246

Please sign in to comment.