mshackman/bofa/src/main/scala/bot/package.scala
2017-11-10 20:00:10 +01:00

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