1use std::sync::Arc; 2 3pub(crate) fn unwrap_or_clone_arc<T: Clone>(arc: Arc<T>) -> T { 4 Arc::try_unwrap(arc).unwrap_or_else(|x| (*x).clone()) 5}