/* * File: list_node.rs * Created Time: 2023-03-05 * Author: sjinzh (sjinzh@gmail.com) */ use std::rc::Rc; use std::cell::RefCell; pub struct ListNode { pub val: T, pub next: Option>>>, } impl ListNode { pub fn new(val: T) -> Rc>> { Rc::new(RefCell::new(ListNode { val, next: None, })) } }