Skip to content

Commit 692c6cb

Browse files
committed
Type: From<Arc<Final>>
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.
1 parent c9276b4 commit 692c6cb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/types/final_data.rs

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//!
1313
1414
use crate::dag::{Dag, DagLike, NoSharing};
15+
use crate::types::{Bound, Type};
1516
use crate::Tmr;
1617

1718
use std::sync::Arc;
@@ -226,6 +227,12 @@ impl Final {
226227
}
227228
}
228229

230+
impl From<Arc<Final>> for Type {
231+
fn from(value: Arc<Final>) -> Self {
232+
Type::from(Bound::Complete(value))
233+
}
234+
}
235+
229236
#[cfg(test)]
230237
mod tests {
231238
use super::*;

0 commit comments

Comments
 (0)