use of moved value: `xxxx`
value used here after moverustc(E0382)
这个错误和 rust 的 ownership、borrowing、lifetime 有关
解决方法:
函数参数加 &mut
,定义变量加 mut
例子
let x = .....
fun(x)
use x // 报错
fun(x: Bytes){
}
解决
let mut x = .....
fun(&mut x)
use x
fun(x: &mut Bytes){
}