I have some code
def decryptRoute(keyId: String, data: ByteString) = onComplete(decrypt(keyId, ByteString(data))) {
case Failure(cause) => complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, s"<h1>decrypting failure</h1>"))
case Success(value) => complete(HttpEntity(ContentTypes.`application/octet-stream`, value))
}
but I cannot seem to find a way to eliminate the surrounding { case… }. I am using IntelliJ with the Dotty support.
Should what I am trying to do be possible, and how? Or am I experiencing some limitation in IntelliJ support for Dotty?