Cannot borrow as mutable variable created with "let mut"
The Rust Programming Language Forum
Cannot borrow as mutable variable created with "let mut"
I'm trying to write a test and running into a problem. Here's the code: fn test_mix3parts_1(plain:&[u8],cipher:&[u8]) { let mut text_copy=plain.clone(); let len=plain.len(); let third=len/3; let rprime=find_max_order(third as u64) as usize; mix3parts(&mut text_copy,len,rprime); assert_eq!(text_copy,cipher); mix3parts(&mut text_copy,len,rprime); assert_eq!(text_copy,plain); } #[test] fn test_mix3parts() { test_mix3parts_1(&[0x00,0x0d,0x1a,0x27,0x34,0x...
0 comments
No comments yet.