tao_of_rust::ch02::binding
pub fn immutable_and_mutable()
Basic usage:
pub fn immutable_and_mutable() { let a = 1; // 默认不可变 // a = 2; // immutable and error: cannot assign twice to immutable variable let mut b = 2; // 使用mut关键字声明可变绑定 b = 3; // mutable } immutable_and_mutable();Run