Using expression functions.
Closed this issue · 3 comments
makovkastar commented
The style guide says that expression functions should not wrap to two lines. But the IDE inspection suggests that even multi-line functions with a single expression should be converted to an expression function:
JakeWharton commented
As you said, this is a multi-line statement but is not a statement that is being forced to wrap. Thus, it is valid as an expression body in the form
override fun convert(from: String) = when (from) {
"N" -> ChargingStatus.Mode.NOT_CONNECTED
...
}
makovkastar commented
Thank you, now it's clear. Closing the issue.
JakeWharton commented
Dupe #36.