MOD: fixed warnings
This commit is contained in:
parent
aa61de33a2
commit
971f1aeaaa
|
|
@ -14,7 +14,7 @@
|
|||
//! a pre-installed wolfSSL at this path. The path must contain
|
||||
//! `include/wolfssl/` and `lib/libwolfssl.a`.
|
||||
|
||||
use std::{env, path::PathBuf};
|
||||
use std::{env, path::{Path, PathBuf}};
|
||||
|
||||
fn main() {
|
||||
// When the `stub_ffi` feature is enabled (e.g. for type-checking without
|
||||
|
|
@ -86,7 +86,7 @@ fn main() {
|
|||
}
|
||||
|
||||
/// Build wolfSSL from source using CMake. Returns `(include_dir, lib_dir)`.
|
||||
fn build_wolfssl_cmake(source_dir: &PathBuf, _out_dir: &PathBuf) -> (PathBuf, PathBuf) {
|
||||
fn build_wolfssl_cmake(source_dir: &Path, _out_dir: &Path) -> (PathBuf, PathBuf) {
|
||||
println!(
|
||||
"cargo:warning=Building wolfSSL from source at {}",
|
||||
source_dir.display()
|
||||
|
|
@ -167,7 +167,7 @@ fn build_wolfssl_cmake(source_dir: &PathBuf, _out_dir: &PathBuf) -> (PathBuf, Pa
|
|||
}
|
||||
|
||||
/// Run bindgen over the wolfCrypt headers we actually use.
|
||||
fn generate_bindings(include_dir: &PathBuf, out_dir: &PathBuf) {
|
||||
fn generate_bindings(include_dir: &Path, out_dir: &Path) {
|
||||
let header = include_dir.join("wolfssl/wolfcrypt/aes.h");
|
||||
|
||||
if !header.exists() {
|
||||
|
|
|
|||
|
|
@ -311,8 +311,8 @@ static XCHACHA20_PROBES: &[XChaChaProbe] = &[
|
|||
// ──────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
fn from_hex(s: &str) -> Vec<u8> {
|
||||
let s = s.replace(' ', "").replace('\n', "");
|
||||
assert!(s.len() % 2 == 0, "odd-length hex: {s}");
|
||||
let s = s.replace([' ', '\n'], "");
|
||||
assert!(s.len().is_multiple_of(2), "odd-length hex: {s}");
|
||||
(0..s.len())
|
||||
.step_by(2)
|
||||
.map(|i| u8::from_str_radix(&s[i..i + 2], 16).unwrap())
|
||||
|
|
|
|||
Loading…
Reference in New Issue