ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.37k stars 4.17k forks source link

removed the 'return' as it was not necessary. #2552

Closed keisukeYamagishi closed 2 months ago

keisukeYamagishi commented 1 year ago

Overview

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."

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)"])
}