首页 > 其他分享 >Rust 链式调用引发的问题 consider using a `let` binding to create a longer lived value

Rust 链式调用引发的问题 consider using a `let` binding to create a longer lived value

时间:2022-10-05 01:33:39浏览次数:43  
标签:lived consider create binding value let 链式

 

 

 

 temporary value dropped while borrowed
consider using a `let` binding to create a longer lived value

为什么会报这个错?

因为maps.lock.unwrap.values...

这一波操作都是链式操作,执行完成后,链式操作中的self 也就是this... 已经销毁了..

所以 后续的n.next再调用的会出错。。。

这rustc编译器也是。。 不同时吧115行标红,只是在提示中给出了..

 

 

 

 

标签:lived,consider,create,binding,value,let,链式
From: https://www.cnblogs.com/cfas/p/16754930.html

相关文章