From 3b64943993d9a045a23ff8d7c3f6f252817af7d1 Mon Sep 17 00:00:00 2001 From: Christian Lewe Date: Mon, 27 May 2024 22:45:42 +0200 Subject: [PATCH] Type: From> If we have a finalized type that we want to use inside the union bound algorithm, then we can convert it to `Type`. The latter is mutable while the former remains unchanged, as expected. --- src/types/final_data.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/types/final_data.rs b/src/types/final_data.rs index 253fc1d0..8088916c 100644 --- a/src/types/final_data.rs +++ b/src/types/final_data.rs @@ -12,6 +12,7 @@ //! use crate::dag::{Dag, DagLike, NoSharing}; +use crate::types::{Bound, Type}; use crate::Tmr; use std::sync::Arc; @@ -226,6 +227,12 @@ impl Final { } } +impl From> for Type { + fn from(value: Arc) -> Self { + Type::from(Bound::Complete(value)) + } +} + #[cfg(test)] mod tests { use super::*;