@@ -10,7 +10,7 @@ use std::ops::Range;
1010/// Encrypts or decrypts a message, using multiple keys. The
1111/// encryption is based on the columnar transposition method.
1212pub fn transposition ( decrypt_mode : bool , msg : & str , key : & str ) -> String {
13- let key_uppercase: String = key. to_uppercase ( ) ;
13+ let key_uppercase = key. to_uppercase ( ) ;
1414 let mut cipher_msg: String = msg. to_string ( ) ;
1515
1616 let keys: Vec < & str > = match decrypt_mode {
@@ -61,7 +61,7 @@ fn encrypt(mut msg: String, key_order: Vec<usize>) -> String {
6161 let mut encrypted_msg: String = String :: from ( "" ) ;
6262 let mut encrypted_vec: Vec < String > = Vec :: new ( ) ;
6363
64- let msg_len: usize = msg. len ( ) ;
64+ let msg_len = msg. len ( ) ;
6565 let key_len: usize = key_order. len ( ) ;
6666
6767 let mut msg_index: usize = msg_len;
@@ -75,7 +75,7 @@ fn encrypt(mut msg: String, key_order: Vec<usize>) -> String {
7575
7676 // Loop every nth character, determined by key length, to create a column
7777 while index < msg_index {
78- let ch: char = msg. remove ( index) ;
78+ let ch = msg. remove ( index) ;
7979 chars. push ( ch) ;
8080
8181 index += key_index;
@@ -123,7 +123,7 @@ fn decrypt(mut msg: String, key_order: Vec<usize>) -> String {
123123 let mut decrypted_vec: Vec < String > = Vec :: new ( ) ;
124124 let mut indexed_vec: Vec < ( usize , String ) > = Vec :: new ( ) ;
125125
126- let msg_len: usize = msg. len ( ) ;
126+ let msg_len = msg. len ( ) ;
127127 let key_len: usize = key_order. len ( ) ;
128128
129129 // Split the message into columns, determined by 'message length divided by keyword length'.
0 commit comments