13 lines
224 B
Swift
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
|
||
|
}
|
||
|
}
|