Conversion SimpleReplacement -> Replacement
Implement
impl From<SimpleReplacement> for Replacement
or a similar dedicated trait to convert a SimpleReplacement to Replacement. This could also be a method on SimpleReplacement, but that would make it impossible to provide blanket implementations of Rewrite<PersistentHugr>.
This is required to be able to add SimpleReplacements to PersistentHugrs, which will (presumably) be made of Replacements.
Note that there is an argument for not implementing From, but rather a custom trait: one could imagine a rewrite struct InlineCall that only stores the Node ID of a call op, but can be turned into a Replacement if it is given a reference to the underlying Hugr: it needs to clone the body of the function to be inlined into the replacement graph. Such a conversion would have the signature fn into_replacement(self, hugr: &impl HugrView) -> Replacement
For the time being I have opted to use SimpleReplacements in PersistentHugr. We can reevaluate this once we have a clearer ideas of the use cases we need to support.
Note that there is already a fn to_replace function already implemented in simple_replace.rs, within the tests. It might be that exposing that is all that is required!