Fix clippy warnings for 1.54

This commit is contained in:
Joshua Nelson 2021-07-29 11:58:58 -04:00
parent 3a0e2db753
commit 6ddfee29b7
3 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ fn mk_ca_cert() -> Result<(X509, PKey<Private>), ErrorStack> {
/// Make a X509 request with the given private key
fn mk_request(privkey: &PKey<Private>) -> Result<X509Req, ErrorStack> {
let mut req_builder = X509ReqBuilder::new()?;
req_builder.set_pubkey(&privkey)?;
req_builder.set_pubkey(privkey)?;
let mut x509_name = X509NameBuilder::new()?;
x509_name.append_entry_by_text("C", "US")?;
@ -75,7 +75,7 @@ fn mk_request(privkey: &PKey<Private>) -> Result<X509Req, ErrorStack> {
let x509_name = x509_name.build();
req_builder.set_subject_name(&x509_name)?;
req_builder.sign(&privkey, MessageDigest::sha256())?;
req_builder.sign(privkey, MessageDigest::sha256())?;
let req = req_builder.build();
Ok(req)
}
@ -133,7 +133,7 @@ fn mk_ca_signed_cert(
.build(&cert_builder.x509v3_context(Some(ca_cert), None))?;
cert_builder.append_extension(subject_alt_name)?;
cert_builder.sign(&ca_privkey, MessageDigest::sha256())?;
cert_builder.sign(ca_privkey, MessageDigest::sha256())?;
let cert = cert_builder.build();
Ok((cert, privkey))

View File

@ -1074,7 +1074,7 @@ fn psk_ciphers() {
client
.ctx()
.set_psk_client_callback(move |_, _, identity, psk| {
identity[..CLIENT_IDENT.len()].copy_from_slice(&CLIENT_IDENT);
identity[..CLIENT_IDENT.len()].copy_from_slice(CLIENT_IDENT);
identity[CLIENT_IDENT.len()] = 0;
psk[..PSK.len()].copy_from_slice(PSK);
CLIENT_CALLED.store(true, Ordering::SeqCst);

View File

@ -131,7 +131,7 @@ pub struct IntoIter<T: Stackable> {
impl<T: Stackable> Drop for IntoIter<T> {
fn drop(&mut self) {
unsafe {
while let Some(_) = self.next() {}
for _ in &mut *self {}
OPENSSL_sk_free(self.stack as *mut _);
}
}