scoop:scoop.std:0.1.0
Selected production source · src/encoding/text_codec.scoop
package scoop
internal fun <T> decodeTextValue(decoder: Decoder, parse: (String) -> T?, description: String): T =
when (parse(decoder.singleValue().readString())) {
case Some(val value) -> value
case None -> throw DecodingException(decoder.path, "invalid " + description)
}