1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::Term;

/// Type that can be turned into a [`Term`].
pub trait IntoTerm {
	/// Node identifier type.
	type Id;

	/// Literal type.
	type Literal;

	/// Turns the value into a [`Term`].
	fn into_term(self) -> Term<Self::Id, Self::Literal>;
}

impl<I, L> IntoTerm for Term<I, L> {
	type Id = I;

	type Literal = L;

	fn into_term(self) -> Term<I, L> {
		self
	}
}