Pre: 'Into' implementation chaining TermWithoutTempIds -> TermWithTempIds -> TermWithTempIdsAndLookupRefs

This commit is contained in:
Grisha Kruglov 2018-07-20 13:10:59 -07:00 committed by Grisha Kruglov
parent e6066769ca
commit 9a47d8905f

View file

@ -181,6 +181,14 @@ impl TermWithTempIds {
}
}
impl TermWithoutTempIds {
pub(crate) fn rewrap<A, B>(self) -> Term<KnownEntidOr<A>, TypedValueOr<B>> {
match self {
Term::AddOrRetract(op, n, a, v) => Term::AddOrRetract(op, Left(n), a, Left(v))
}
}
}
/// Given a `KnownEntidOr` or a `TypedValueOr`, replace any internal `LookupRef` with the entid from
/// the given map. Fail if any `LookupRef` cannot be replaced.
///