Attribute
Attribute
Discardable Result
To ignore the return value or know the return value.
You can eliminate underscore replacements when you're sure you won't be using the return value.
enum APIProvider {
@discardableResult static func update(_ name: String) -> Result<User, Error> {
// .. Handle API endpoint, example result:
return .success(User(name: name))
}
}
// Old Usage
_ = APIProvider.update(name)
// New Usage
APIProvider.update(name)