This is an exception to https://github.com/realm/SwiftLint/issues/54.
If the trailing closure is simple then prefer
result.map(stripTrailingWhitespace)
instead of
result.map { stripTrailingWhitespace($0) }
reference:
https://github.com/exercism/xswift/pull/209#discussion_r90971304
I don't think this is directly related to #54, as it would just validate this behavior:
// triggers
result.map({ stripTrailingWhitespace($0) })
// ok
result.map { stripTrailingWhitespace($0) }
"Trailing closure syntax should be used whenever possible."?
I don't think the description totally matches what it'd be validated. Maybe @jpsim can confirm, but I feel that rule would just validate that if it's a closure and it's the last parameter, trailing syntax should be used. Function references would always be valid for that rule.
@marcelofabri's last comment is spot on 馃憣. I would like a rule that can recommend using result.map(stripTrailingWhitespace) over result.map { stripTrailingWhitespace($0) } but in practice, that's challenging to build because you need to detect whether or not doing so would be ambiguous (e.g. cannot resolve between function overloads by the same name).
Most helpful comment
I don't think this is directly related to #54, as it would just validate this behavior: