CHGenerator/WebsiteGenerator/Extensions/Optional+Extensions.swift
Christoph Hagen 14b935249f First version
2022-08-16 10:39:05 +02:00

13 lines
224 B
Swift

import Foundation
import Metal
extension Optional {
func unwrapped<T>(_ closure: (Wrapped) -> T) -> T? {
if case let .some(value) = self {
return closure(value)
}
return nil
}
}