Does RefCell::borrow move the contents?
Does RefCell::borrow move the contents?
I have a linked-list sort of struct, using Option, Rc, and RefCell.
I’d like to implement fmt::Debug for it, but have run into the lovely “cannot move out of borrowed content” error.
use std::fmt; use std::rc::{Rc, Weak}; use std::cell::RefCell; #[derive(Clone, Debug, Ord, Eq, PartialOrd, PartialEq)] struct NodeId {id: String} impl NodeId { pub fn new(s: &str) -> NodeId { NodeId{id:…
View On WordPress








