Rust can’t figure out the type of a borrowed value [duplicate]
This question already has an answer here: Rust Rc<RefCell>::borrow_mut returns &mut Rc<RefCell<T>> instead of RefMut<T> (1 answer) Closed 16 hours ago. type NodePointer<T> = Option<Rc<RefCell<Node<T>>>>; #[derive(Debug)] struct Node<T> { val: T, next: NodePointer<T> } pub struct LinkedList<T> { head: NodePointer<T>, tail: NodePointer<T>, length: u32 } impl <T: Display> Display for LinkedList<T> { fn fmt(&self, f: […]
Rust can’t figure out the type of a borrowed value [duplicate]
This question already has an answer here: Rust Rc<RefCell>::borrow_mut returns &mut Rc<RefCell<T>> instead of RefMut<T> (1 answer) Closed 16 hours ago. type NodePointer<T> = Option<Rc<RefCell<Node<T>>>>; #[derive(Debug)] struct Node<T> { val: T, next: NodePointer<T> } pub struct LinkedList<T> { head: NodePointer<T>, tail: NodePointer<T>, length: u32 } impl <T: Display> Display for LinkedList<T> { fn fmt(&self, f: […]