Rust:cannot assign twice to immutable variable `x`错误解决方法
在rust语言中,变量默认情况下是不允许被改变的,当你试图修改一个不可变变量时,将造成 error[E0384]: cannot assign twice to immutable variable `x` 这样的错误;
你可以在变量名前加上关键字 mut
使其变得可变;
更详细的信息请参考:
转载声明
本文版权归作者所有
如需转载,请注明出处;本文地址: https://www.perfcode.com/p/cannot-assign-twice-to-immutable-variable.html