Skip to content

Commit 9c91ec0

Browse files
committed
lints: enable and address unused_qualifications
1 parent 809bbab commit 9c91ec0

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ pretty_assertions = "1"
2323
trivial_numeric_casts = "warn"
2424
unused_import_braces = "warn"
2525
unused_extern_crates = "warn"
26+
unused_qualifications = "warn"

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ impl SslSession {
325325
u64::from_le_bytes(slice.try_into().unwrap())
326326
}
327327

328-
let usize_len = mem::size_of::<usize>();
329-
let u64_len = mem::size_of::<u64>();
328+
let usize_len = size_of::<usize>();
329+
let u64_len = size_of::<u64>();
330330

331331
let (magic, slice) = split_at(slice, SslSession::MAGIC.len())?;
332332
if magic != SslSession::MAGIC {
@@ -436,7 +436,7 @@ pub struct SslContext {
436436
raw_options: u64,
437437
verify_mode: VerifyMode,
438438
verify_depth: c_int,
439-
verify_x509_store: x509::OwnedX509Store,
439+
verify_x509_store: OwnedX509Store,
440440
alpn: Vec<Vec<u8>>,
441441
default_cert_file: Option<PathBuf>,
442442
default_cert_dir: Option<PathBuf>,
@@ -749,7 +749,7 @@ struct Ssl {
749749
verify_mode: VerifyMode,
750750
verify_depth: c_int,
751751
verify_server_name: Option<ServerName<'static>>,
752-
verify_x509_store: x509::OwnedX509Store,
752+
verify_x509_store: OwnedX509Store,
753753
alpn: Vec<Vec<u8>>,
754754
alpn_callback: callbacks::AlpnCallbackConfig,
755755
cert_callback: callbacks::CertCallbackConfig,
@@ -1448,15 +1448,15 @@ impl Ssl {
14481448
}
14491449
}
14501450

1451-
fn load_verify_certs(ctx: &SslContext) -> Result<x509::OwnedX509Store, error::Error> {
1451+
fn load_verify_certs(ctx: &SslContext) -> Result<OwnedX509Store, error::Error> {
14521452
// If verify_roots isn't empty then it was configured with `SSL_CTX_load_verify_file`
14531453
// or `SSL_CTX_load_verify_dir` and we should use it as-is.
14541454
if !ctx.verify_x509_store.is_empty() {
14551455
return Ok(ctx.verify_x509_store.clone());
14561456
}
14571457

14581458
// Otherwise, try to load the default cert file or cert dir.
1459-
let mut verify_roots = x509::OwnedX509Store::default();
1459+
let mut verify_roots = OwnedX509Store::default();
14601460

14611461
if let Some(default_cert_file) = &ctx.default_cert_file {
14621462
verify_roots.add_from_files([default_cert_file.to_path_buf()])?;

0 commit comments

Comments
 (0)