10 lines
No EOL
221 B
Scala
10 lines
No EOL
221 B
Scala
import scala.util.control.Exception.allCatch
|
|
|
|
package object bot {
|
|
implicit class OptionInt(s: String) {
|
|
def toOptInt: Option[Int] = s match {
|
|
case "" => None
|
|
case _ => allCatch.opt(s.toInt)
|
|
}
|
|
}
|
|
} |