mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
Moving local variable declaration closer to usage
This commit is contained in:
1 parent
73ae6adb46
commit
ea66bd9938
1 file changed
+1
-2
@@ -132,7 +132,6 @@ impl ClientSession {
|
||||
pub fn new() -> Self {
|
||||
let mut request_body_key = vec![0u8; 16];
|
||||
let mut request_body_iv = vec![0u8; 16];
|
||||
let response_header: u8;
|
||||
|
||||
// fill random bytes
|
||||
let mut rand_bytes = BytesMut::with_capacity(16 + 16 + 1);
|
||||
@@ -143,7 +142,7 @@ impl ClientSession {
|
||||
}
|
||||
(&mut request_body_key[..]).copy_from_slice(&rand_bytes[..16]);
|
||||
(&mut request_body_iv[..]).copy_from_slice(&rand_bytes[16..32]);
|
||||
response_header = rand_bytes[32];
|
||||
let response_header: u8 = rand_bytes[32];
|
||||
|
||||
let response_body_key = Md5::digest(&request_body_key).to_vec();
|
||||
let response_body_iv = Md5::digest(&request_body_iv).to_vec();
|
||||
|
||||
Reference in new issue
Block a user