diff --git a/src/impl_arc_array.rs b/src/impl_arc_array.rs index 724cfe51d..f88f8083e 100644 --- a/src/impl_arc_array.rs +++ b/src/impl_arc_array.rs @@ -6,8 +6,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use alloc::sync::Arc; use crate::imp_prelude::*; +use alloc::sync::Arc; /// Methods specific to `ArcArray`. /// @@ -17,7 +17,9 @@ where D: Dimension, { /// Returns `true` iff the inner `Arc` is not shared. - pub fn is_unique(&mut self) -> bool { - Arc::get_mut(&mut self.data.0).is_some() + /// If you want to ensure the Arc is not concurrently cloned, you need to provide a `&mut self` to this function. + pub fn is_unique(&self) -> bool { + // Only strong pointers are used in this crate. + Arc::strong_count(&self.data.0) == 1 } }