Avatar
僕はこう書いてます let foo = self.foo.ensure { Foo(...) } @discardableResult public mutating func ensure(_ f: () throws -> Wrapped) rethrows -> Wrapped { if let x = self { return x } let x = try f() self = x return x }