Skip to content

Commit 3f4646a

Browse files
committed
removed use of unstable Option::inspect
1 parent 88196a7 commit 3f4646a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

russh/src/server/encrypted.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,9 @@ impl Encrypted {
426426
debug!("signature = {:?}", signature);
427427
let mut s = signature.reader(0);
428428
let algo_ = s.read_string().map_err(crate::Error::from)?;
429-
key::SignatureHash::from_rsa_hostkey_algo(algo_)
430-
.inspect(|hash| pubkey.set_algorithm(*hash));
429+
if let Some(hash) = key::SignatureHash::from_rsa_hostkey_algo(algo_) {
430+
pubkey.set_algorithm(hash);
431+
}
431432
debug!("algo_: {:?}", algo_);
432433
let sig = s.read_string().map_err(crate::Error::from)?;
433434
#[allow(clippy::indexing_slicing)] // length checked

0 commit comments

Comments
 (0)