Skip to content

Commit 0b7e667

Browse files
committed
kfd: fixup warning
Signed-off-by: Arthur Gautier <[email protected]>
1 parent 116ea8b commit 0b7e667

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

openssl-sys/src/ossl_typ.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,6 @@ cfg_if! {
10621062

10631063
cfg_if! {
10641064
if #[cfg(ossl300)] {
1065-
#[repr(C)]
1066-
// TODO(baloo): is that safe?
1067-
pub struct OSSL_LIB_CTX {}
1065+
pub enum OSSL_LIB_CTX {}
10681066
}
10691067
}

openssl/src/kdf.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
use cfg_if::cfg_if;
21
use std::error;
32
use std::ffi::{CStr, CString, NulError};
43
use std::fmt;
5-
use std::io;
6-
use std::io::prelude::*;
7-
use std::ops::{Deref, DerefMut};
84
use std::ptr;
95
use std::str;
106

117
use crate::error::ErrorStack;
128
use crate::hash::MessageDigest;
13-
use crate::nid::Nid;
149
use crate::params::{Params, ParamsBuilder};
1510
use crate::{cvt, cvt_cp, cvt_p};
1611

17-
use ffi::{EVP_KDF_CTX_free, EVP_KDF_CTX_new};
18-
1912
#[derive(Debug)]
2013
pub enum KDFError {
2114
Utf8Error(str::Utf8Error),
@@ -43,7 +36,7 @@ impl From<ErrorStack> for KDFError {
4336
}
4437

4538
impl fmt::Display for KDFError {
46-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
39+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4740
use KDFError::*;
4841
match self {
4942
Utf8Error(ref e) => e.fmt(f),

openssl/src/params.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ pub struct ParamsBuilder(Vec<(&'static [u8], Param)>);
8484

8585
impl ParamsBuilder {
8686
pub fn with_capacity(capacity: usize) -> Self {
87-
let mut params = Vec::with_capacity(capacity);
87+
let params = Vec::with_capacity(capacity);
8888
Self(params)
8989
}
9090

91-
pub fn build(mut self) -> Params {
91+
pub fn build(self) -> Params {
9292
let len = self.0.len();
9393

9494
let mut params = Params {
@@ -106,17 +106,17 @@ impl ParamsBuilder {
106106
use Param::*;
107107
let v = unsafe {
108108
match p {
109-
I32(mut v) => {
109+
I32(v) => {
110110
let pname = name.as_ptr() as *const i8;
111-
ffi::OSSL_PARAM_construct_int(pname, v)
111+
ffi::OSSL_PARAM_construct_int(pname, *v)
112112
}
113-
Vec(mut buf, len) => {
113+
Vec(buf, len) => {
114114
let pname = name.as_ptr() as *const i8;
115-
ffi::OSSL_PARAM_construct_octet_string(pname, buf, *len)
115+
ffi::OSSL_PARAM_construct_octet_string(pname, *buf, *len)
116116
}
117-
String(mut buf, len) => {
117+
String(buf, len) => {
118118
let pname = name.as_ptr() as *const i8;
119-
ffi::OSSL_PARAM_construct_utf8_string(pname, buf, *len)
119+
ffi::OSSL_PARAM_construct_utf8_string(pname, *buf, *len)
120120
}
121121
}
122122
};

0 commit comments

Comments
 (0)