Closed keisukeYamagishi closed 2 months ago
I removed unnecessary code.
In accordance with Swift language specifications, having no return is acceptable and, in fact, recommended as it makes the code less verbose."
Swift
return
Example bellow code
func exampleError(_ error: String, location: String = "\(#file):\(#line)") -> NSError { return NSError(domain: "ExampleError", code: -1, userInfo: [NSLocalizedDescriptionKey: "\(location): \(error)"]) -> NSError(domain: "ExampleError", code: -1, userInfo: [NSLocalizedDescriptionKey: "\(location): \(error)"]) }
Overview
I removed unnecessary code.
In accordance with
Swift
language specifications, having noreturn
is acceptable and, in fact, recommended as it makes the code less verbose."Example bellow code