diff --git a/implementations/rust/preserves/src/value/repr.rs b/implementations/rust/preserves/src/value/repr.rs index 305569e..f703436 100644 --- a/implementations/rust/preserves/src/value/repr.rs +++ b/implementations/rust/preserves/src/value/repr.rs @@ -1389,7 +1389,10 @@ impl NestedValue for ArcValue { #[inline(always)] fn value_owned(self) -> Value { - Arc::try_unwrap(self.0).unwrap_or_else(|_| panic!("value_owned on ArcValue with refcount greater than one")).1 + match Arc::try_unwrap(self.0) { + Ok(AnnotatedValue(_anns, v)) => v, + Err(r) => r.1.clone(), + } } }