Skip to content

Commit f468230

Browse files
authored
Remove unnecessary clones from examples and tests (#540)
1 parent 55244b6 commit f468230

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

aes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//! // Initialize cipher
6666
//! let cipher = Aes128::new(&key);
6767
//!
68-
//! let block_copy = block.clone();
68+
//! let block_copy = block;
6969
//!
7070
//! // Encrypt block in-place
7171
//! cipher.encrypt_block(&mut block);

aria/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! // Initialize cipher
1919
//! let cipher = Aria128::new(&key);
2020
//!
21-
//! let block_copy = block.clone();
21+
//! let block_copy = block;
2222
//! // Encrypt block in-place
2323
//! cipher.encrypt_block(&mut block);
2424
//! // And decrypt it back

cast5/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! // Initialize cipher
1919
//! let cipher = Cast5::new(&key);
2020
//!
21-
//! let block_copy = block.clone();
21+
//! let block_copy = block;
2222
//! // Encrypt block in-place
2323
//! cipher.encrypt_block(&mut block);
2424
//! // And decrypt it back

cast6/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! // Initialize cipher
1919
//! let cipher = Cast6::new(&key);
2020
//!
21-
//! let block_copy = block.clone();
21+
//! let block_copy = block;
2222
//! // Encrypt block in-place
2323
//! cipher.encrypt_block(&mut block);
2424
//! // And decrypt it back

speck/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ macro_rules! new_test {
2222
let ciphertext = hex!($ct_hex);
2323
let cipher = $cipher::new(&key.into());
2424

25-
let mut block = plaintext.clone().into();
25+
let mut block = plaintext.into();
2626
cipher.encrypt_block(&mut block);
2727

2828
assert_eq!(&ciphertext, block.as_slice());

twofish/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ macro_rules! new_test {
1717
for i in 1..50 {
1818
let twofish = Twofish::new_from_slice(&key).unwrap();
1919

20-
let mut buf = plain.clone();
20+
let mut buf = plain;
2121
twofish.encrypt_block(&mut buf);
22-
cipher = buf.clone();
22+
cipher = buf;
2323
twofish.decrypt_block(&mut buf);
2424
assert_eq!(plain, buf);
2525

0 commit comments

Comments
 (0)