cargo builderror[E0515]: cannot return value referencing temporary value--> src/fourth.rs:66:13|66|&node.borrow().elem|^----------^^^^^||||| temporary value created here||| returns a value referencing data owned by the current function
> cargo builderror[E0412]: cannot find type `Ref` in this scope--> src/fourth.rs:63:40|63|pubfnpeek_front(&self) ->Option<Ref<T>> {|^^^ not found in this scopehelp: possible candidates are found in other modules, you can import them into scope|1|use core::cell::Ref;|1|use std::cell::Ref;|
必须导入相关
use std::cell::{Ref, RefCell};
> cargo builderror[E0308]: mismatched types--> src/fourth.rs:64:9|64|/ self.head.as_ref().map(|node| {65|| node.borrow()66|| })||__________^ expected type parameter, found struct `fourth::Node`|= note: expected type `std::option::Option<std::cell::Ref<'_, T>>` found type `std::option::Option<std::cell::Ref<'_, fourth::Node<T>>>`