error: the order of `mut` and `ref` is incorrect--> src/main.rs:14:14|14|Some(mutref age) => {|^^^^^^^ help:try switching the order: `refmut`error: aborting due to previous error
练习2
您需要为要交换的两个参数提供可变引用。 此外,为了获得对 res 的可变引用,res 本身需要是可变的:
fnmain() {let bytearray1:&'static [u8; 22] =b"Hello World in binary!";let bytearray2:&'static [u8] =b"Hello World in binary!";println!("{:?}", bytearray1);println!("{:?}", bytearray2);}