summaryrefslogtreecommitdiff
path: root/rust/src/types.rs
diff options
context:
space:
mode:
authorMichael Krasnitski <michael.krasnitski@gmail.com>2023-07-18 08:55:26 -0400
committerKyle Martin <krm504@nyu.edu>2023-07-25 20:41:20 -0400
commitf9ec3de483beb94f8e2a3ba78d87cdbd6b559e51 (patch)
treef771967cf82115c4184ff6e9b489dbe31b41035c /rust/src/types.rs
parentc1d1773c23ea73490fbf33dea75e95c7d6ab4c6f (diff)
impl `From<&'a Ref<T>>` for `Conf<&'a T>`
Diffstat (limited to 'rust/src/types.rs')
-rw-r--r--rust/src/types.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs
index 93d0f233..9d9e25cb 100644
--- a/rust/src/types.rs
+++ b/rust/src/types.rs
@@ -188,6 +188,12 @@ impl<'a, T: RefCountable> From<&'a Conf<Ref<T>>> for Conf<&'a T> {
}
}
+impl<'a, T: RefCountable> From<&'a Ref<T>> for Conf<&'a T> {
+ fn from(r: &'a Ref<T>) -> Self {
+ r.as_ref().into()
+ }
+}
+
#[inline]
pub fn min_confidence() -> u8 {
u8::MIN