Skip to content

Commit 62ab862

Browse files
committed
small fixes and clippy
- fix build with pkg-config - handle clippy warnings - skip tests for esdm and jitter rng Signed-off-by: Markus Theil <[email protected]>
1 parent f7cfc0d commit 62ab862

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

botan-sys/build/main.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,14 @@ fn find_botan_include_dir() -> std::path::PathBuf {
159159
for major in [3, 2] {
160160
let lib_name = format!("botan-{}", major);
161161

162-
let statik = if cfg!(feature = "static") {
163-
true
164-
} else {
165-
false
166-
};
162+
let statik = cfg!(feature = "static");
167163

168164
if let Ok(config) = pkg_config::Config::new().statik(statik).probe(&lib_name) {
169165
return config.include_paths[0].clone();
170166
}
171167
}
168+
169+
panic!("Unable to find the headers corresponding with any supported version of Botan");
172170
}
173171

174172
#[cfg(not(feature = "pkg-config"))]
@@ -206,7 +204,7 @@ fn find_botan_include_dir() -> std::path::PathBuf {
206204
}
207205
}
208206

209-
panic!("Unable to find the headers cooresponding with any supported version of Botan");
207+
panic!("Unable to find the headers corresponding with any supported version of Botan");
210208
}
211209
}
212210

botan/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ default = ["std"]
2525
std = []
2626
vendored = ["botan-sys/vendored"]
2727
static = ["botan-sys/static"]
28-
pkg-config = ["botan-sys/pkg-config"]
28+
pkg-config = ["botan-sys/pkg-config"]
29+
30+
[lints.clippy]
31+
# introduced because of from_str
32+
should_implement_trait = "allow"

botan/src/rng.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ impl RandomNumberGenerator {
5252

5353
/// Create a new reference to the ESDM PRNG (fully seeded)
5454
///
55+
/// Availability of this RNG depends on botan being compiled
56+
/// with ESDM support.
57+
///
5558
/// # Examples
56-
/// ```
59+
/// ```ignore
5760
/// let esdm_rng = botan::RandomNumberGenerator::new_esdm().unwrap();
5861
/// ```
5962
pub fn new_esdm() -> Result<RandomNumberGenerator> {
@@ -62,8 +65,11 @@ impl RandomNumberGenerator {
6265

6366
/// Create a new reference to the ESDM PRNG (with prediction resistance)
6467
///
68+
/// Availability of this RNG depends on botan being compiled
69+
/// with ESDM support.
70+
///
6571
/// # Examples
66-
/// ```
72+
/// ```ignore
6773
/// let esdm_rng = botan::RandomNumberGenerator::new_esdm_pr().unwrap();
6874
/// ```
6975
pub fn new_esdm_pr() -> Result<RandomNumberGenerator> {
@@ -72,8 +78,11 @@ impl RandomNumberGenerator {
7278

7379
/// Create a new reference to the Jitter RNG
7480
///
81+
/// Availability of this RNG depends on botan being compiled
82+
/// with Jitter RNG support.
83+
///
7584
/// # Examples
76-
/// ```
85+
/// ```ignore
7786
/// let jitter_rng = botan::RandomNumberGenerator::new_jitter().unwrap();
7887
/// ```
7988
pub fn new_jitter() -> Result<RandomNumberGenerator> {

0 commit comments

Comments
 (0)