forked from M-Labs/nac3
core/model: add From<BasicValueEnum> for Opaque
This commit is contained in:
parent
5c6537565c
commit
d2ab7b89be
|
@ -48,3 +48,10 @@ impl<'ctx> Model<'ctx> for OpaqueModel<'ctx> {
|
|||
}
|
||||
|
||||
pub type Opaque<'ctx> = Instance<'ctx, OpaqueModel<'ctx>>;
|
||||
|
||||
impl<'ctx> From<BasicValueEnum<'ctx>> for Opaque<'ctx> {
|
||||
fn from(value: BasicValueEnum<'ctx>) -> Self {
|
||||
let model = OpaqueModel(value.get_type());
|
||||
model.believe_value(value)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue