I have the following code:
private def formatQuery(q:String = ""):String = {
val q2 = if (q=="") "*" else "'%s'".format(q)
[...]
I'd just like to know if there's some idiomatic way to avoid declaring the q2 value
someting like
private def formatQuery(
q:String = if (q=="") "*" else "'%s'".format(q)
):String = {
[...]
which obviously doesn't work