1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use std::borrow::Cow; use iri_rs::IriBuf; use crate::CowLiteral; use super::Term; pub enum CowTerm<'a> { Iri(Cow<'a, IriBuf>), Literal(CowLiteral<'a>), } impl CowTerm<'_> { pub fn into_owned(self) -> Term { match self { Self::Iri(iri) => Term::Iri(iri.into_owned()), Self::Literal(l) => Term::Literal(l.into_owned()), } } } impl From<Term> for CowTerm<'_> { fn from(value: Term) -> Self { value.into_cow() } }