Is there a way to only match part of a `Pair` matc...
# functional
r
Is there a way to only match part of a
Pair
match?
Copy code
val mimes = rec.mimeType.split("/")
when (mimes[0] to mimes[1]) {
  "text" to "vcard" -> {}
  "video" to _ -> {}
}
^ the second one isn't really working out.
j
Probably not what you wanted to hear, but I'd just avoid using
Pair
in this case:
Copy code
val mimes = rec.mimeType.split("/")
when {
  mimes[0] == "text" && mimes[1] == "vcard" -> {}
  mimes[0] == "video" -> {}
}
Or maybe using nested `when`s, if there were many branching posibilities...