usestd::sync::Arc;/// Trait for values being taken.
pubtraitTakeAs<T> {/// Takes the inner value if there is exactly one strong reference and
/// clones it otherwise.
fntake(self)-> T;}impl<T:Clone>TakeAs<T>forArc<T>{fntake(self)-> T{matchArc::try_unwrap(self){Ok(v)=> v,Err(rc)=>(*rc).clone(),}}}