forked from syndicate-lang/preserves
Fix value_owned for ArcValue
This commit is contained in:
parent
55b02b9cff
commit
5260f85952
|
@ -1389,7 +1389,10 @@ impl<D: Embeddable> NestedValue for ArcValue<D> {
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn value_owned(self) -> Value<Self> {
|
fn value_owned(self) -> Value<Self> {
|
||||||
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(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue