13.2.1 Mutability
데이터의 가변성은 소유권이 이전되면서 변경될 수 있다. Mutability of data can be changed when ownership is transferred.
fn main() {
let immutable_box = Box::new(5u32);
println!("immutable_box contains {}", immutable_box);
// 가변성 에러!
//*immutable_box = 4;
// 박스를 *옮기자*, 소유권을 변경하자 (가변성도)
let mut mutable_box = immutable_box;
println!("mutable_box contains {}", mutable_box);
// 박스의 내용을 수정.
*mutable_box = 4;
println!("mutable_box now contains {}", mutable_box);
}