Skip to content

Commit 18078f9

Browse files
committed
Rounding out the changes
1 parent 106fdd7 commit 18078f9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/ciphers/diffie_hellman.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,8 @@ impl DiffieHellman {
228228
// Both parties now have the same shared secret key s which can be used for encryption or authentication.
229229

230230
pub fn new(group: Option<u8>) -> Self {
231-
let mut _group: u8 = 14;
232-
if let Some(x) = group {
233-
_group = x;
234-
}
235-
231+
// made this idiomatic according to clippy's suggestions
232+
let _group = group.unwrap_or(14);
236233
if !PRIMES.contains_key(&_group) {
237234
panic!("group not in primes")
238235
}

0 commit comments

Comments
 (0)