Skip to content

Commit 29ee116

Browse files
committed
improvements thanks to cargo clippy
1 parent af0ae5e commit 29ee116

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/becke_partitioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn partitioning_weight(
8585
let u_ab = (r_a + r_b) / (r_b - r_a);
8686
let a_ab = u_ab / (u_ab * u_ab - 1.0);
8787

88-
nu_ab += a_ab.min(0.5).max(-0.5) * (1.0 - mu_ab * mu_ab);
88+
nu_ab += a_ab.clamp(-0.5, 0.5) * (1.0 - mu_ab * mu_ab);
8989
}
9090

9191
let f = f3(nu_ab, hardness);

src/bse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ pub fn ang_min_and_max(basis_set: &str, element: usize) -> (HashMap<usize, f64>,
3737

3838
let element = resp.elements.get(&element.to_string()).unwrap();
3939

40-
let mut alpha_max = -std::f64::MAX;
40+
let mut alpha_max = -f64::MAX;
4141
let mut alpha_min = HashMap::new();
4242

4343
for shell in &element.electron_shells {
4444
let angular_momentum = shell.angular_momentum[0];
4545
for exponent_string in &shell.exponents {
4646
let exponent: f64 = exponent_string.parse().unwrap();
4747
alpha_max = alpha_max.max(exponent);
48-
let s = alpha_min.entry(angular_momentum).or_insert(std::f64::MAX);
48+
let s = alpha_min.entry(angular_momentum).or_insert(f64::MAX);
4949
if &exponent < s {
5050
*s = exponent;
5151
}

src/radial.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn radial_grid_lmg(
9393
// factor 2.0 to match DIRAC code
9494
let r_inner = get_r_inner(radial_precision, alpha_max * 2.0);
9595

96-
let mut h = std::f64::MAX;
96+
let mut h = f64::MAX;
9797
let mut r_outer: f64 = 0.0;
9898

9999
// we need alpha_min sorted by l
@@ -160,7 +160,7 @@ fn test_get_r_inner() {
160160
// TCA 106, 178 (2001), eq. 19
161161
fn get_r_outer(max_error: f64, alpha_outer: f64, l: usize, guess: f64) -> f64 {
162162
let m = (2 * l) as f64;
163-
let mut r_old = std::f64::MAX;
163+
let mut r_old = f64::MAX;
164164
let mut step = 0.5;
165165
let mut sign = 1.0;
166166
let mut r = guess;
@@ -229,7 +229,7 @@ fn test_get_r_outer() {
229229
// TCA 106, 178 (2001), eqs. 17 and 18
230230
fn get_h(max_error: f64, l: usize, guess: f64) -> f64 {
231231
let m = (2 * l) as f64;
232-
let mut h_old = std::f64::MAX;
232+
let mut h_old = f64::MAX;
233233
let mut h = guess;
234234
let mut step = 0.1 * guess;
235235
let mut sign = -1.0;

src/tables/weights.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(clippy::unreadable_literal)]
22

3-
pub const WEIGHTS: [f64; 46976] = [
3+
pub static WEIGHTS: [f64; 46976] = [
44
0.166666666666667,
55
0.166666666666667,
66
0.166666666666667,

0 commit comments

Comments
 (0)