diff --git a/src/ops/custom.rs b/src/ops/custom.rs index b179a7bb2..61b489145 100644 --- a/src/ops/custom.rs +++ b/src/ops/custom.rs @@ -59,6 +59,13 @@ impl From for LeafOp { } } +impl From for OpType { + fn from(value: ExternalOp) -> Self { + let leaf: LeafOp = value.into(); + leaf.into() + } +} + impl ExternalOp { /// Name of the ExternalOp pub fn name(&self) -> SmolStr { @@ -235,6 +242,19 @@ impl OpaqueOp { } } +impl From for LeafOp { + fn from(value: OpaqueOp) -> Self { + LeafOp::CustomOp(Box::new(ExternalOp::Opaque(value))) + } +} + +impl From for OpType { + fn from(value: OpaqueOp) -> Self { + let leaf: LeafOp = value.into(); + leaf.into() + } +} + /// Resolve serialized names of operations into concrete implementation (OpDefs) where possible #[allow(dead_code)] pub fn resolve_extension_ops(