ONQEIR5BV26QJSI3HY7B3MN6VWEGSZIXAIUIANJ5ZLR3QN3DFGEAC
impl TryFrom<Meta> for Mime {
type Error = String;
fn try_from(meta: Meta) -> Result<Self, Self::Error> {
let (typ, sub) = meta
.0
.split_once('/')
.ok_or(format!("invalid MIME type: {}", meta.0))?;
Ok(Self {
typ: typ.to_owned(),
sub: sub.to_owned(),
})
impl From<Meta> for Mime {
fn from(value: Meta) -> Self {
value.0.parse().unwrap()