Having hard time managing compounds of references and dereferences

后端 未结 0 1121
野的像风
野的像风 2020-12-28 19:53
let mut x = 1;
let a = &mut x;
let b = &mut *a;
*a = 2; // error. b borrows a
*b = 3; // it works!
let mut x = 1;
let b;
{
    let a         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题