Created
November 4, 2023 11:44
-
-
Save calvingit/23ed08e4fdc32e37fb5016aa473fc025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 简化多次赋值的变量初始化 | |
public protocol Then {} | |
extension Then { | |
@discardableResult | |
@inlinable | |
public func `do`(_ block: (Self) throws -> Void) rethrows -> Self { | |
try block(self) | |
return self | |
} | |
} | |
extension NSObject: Then {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment