diff options
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index d86ffc82..04cb93fc 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -2446,7 +2446,7 @@ unsafe impl<'a> CoreArrayWrapper<'a> for QualifiedNameTypeAndId { pub struct NameAndType<S: BnStrCompatible> { pub name: S, - t: Conf<Ref<Type>>, + pub t: Conf<Ref<Type>>, } impl NameAndType<String> { @@ -2467,6 +2467,17 @@ impl<S: BnStrCompatible> NameAndType<S> { } } + pub(crate) fn into_raw(self) -> BNNameAndType { + let t = self.t.clone(); + let res = BNNameAndType { + name: BnString::new(self.name).into_raw(), + type_: t.contents.handle, + typeConfidence: self.t.confidence, + }; + mem::forget(t); + res + } + pub fn type_with_confidence(&self) -> Conf<Ref<Type>> { self.t.clone() } |
