Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustRc and ArcSingle-choice MCQ

Given a reference-counted value, which expression returns a mutable reference to the inner data only when this is the sole strong owner with no outstanding weak pointers, leaving the `Rc` intact otherwise?

use std::rc::Rc; let mut shared: Rc<String> = Rc::new(String::from("hi"));