Rust:variable does not need to be mutable警告解决方法
在Rust中,当你使用了mut
关键字声明变量,但你后面的代码并没对该关键字进行修改,则rust编译器会产生 variable does not need to be mutable的警告提示;
解决方法
将该变量前的mut
关键字移除。
在Rust中,当你使用了mut
关键字声明变量,但你后面的代码并没对该关键字进行修改,则rust编译器会产生 variable does not need to be mutable的警告提示;
将该变量前的mut
关键字移除。
原创内容,如需转载,请注明出处;
本文地址: https://www.perfcode.com/p/variable-does-not-need-to-be-mutable.html
C语言、Python、Rust一对一辅导、答疑;