We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 106fdd7 commit 18078f9Copy full SHA for 18078f9
src/ciphers/diffie_hellman.rs
@@ -228,11 +228,8 @@ impl DiffieHellman {
228
// Both parties now have the same shared secret key s which can be used for encryption or authentication.
229
230
pub fn new(group: Option<u8>) -> Self {
231
- let mut _group: u8 = 14;
232
- if let Some(x) = group {
233
- _group = x;
234
- }
235
-
+ // made this idiomatic according to clippy's suggestions
+ let _group = group.unwrap_or(14);
236
if !PRIMES.contains_key(&_group) {
237
panic!("group not in primes")
238
}
0 commit comments