Skip to content

Commit 2d4da07

Browse files
committed
fix(ci): resolve clippy neg_multiply warnings and commit .nvmrc
- Fix clippy::neg_multiply warnings across dynamical systems and ODE tests - Track and commit .nvmrc and rust-toolchain.toml for GitHub Actions workflows
1 parent cbe5f69 commit 2d4da07

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.12.0

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
channel = "1.81.0"
3+
components = ["clippy", "rustfmt"]
4+
profile = "minimal"
5+
targets = ["wasm32-unknown-unknown"]

src/continuous_ds.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ mod tests {
535535
let val = ode.vector_field(pos).unwrap();
536536

537537
assert!((val.x - (2.0 * 0.5 - 2.0)).abs() < 1e-12);
538-
assert!((val.y - (-1.5 * -2.0)).abs() < 1e-12);
538+
assert!((val.y - (1.5 * 2.0)).abs() < 1e-12);
539539
}
540540

541541
#[test]
@@ -620,8 +620,8 @@ mod tests {
620620
let pos = Vector2::new(2.0, -1.0);
621621
let val = ode.vector_field(pos).unwrap();
622622

623-
assert!((val.x - (1.1 * 2.0 + -0.3 * -1.0 + 0.7)).abs() < 1e-12);
624-
assert!((val.y - (2.0 * 2.0 + -1.5 * -1.0)).abs() < 1e-12);
623+
assert!((val.x - (1.1 * 2.0 + 0.3 * 1.0 + 0.7)).abs() < 1e-12);
624+
assert!((val.y - (2.0 * 2.0 + 1.5 * 1.0)).abs() < 1e-12);
625625
}
626626

627627
#[test]

src/dynamical_systems.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ mod tests {
362362
let pos = Vector2::new(2.0, -1.0);
363363
let result = system.map(pos).unwrap();
364364

365-
assert!((result.x - (1.5 * 2.0 + -0.25 * -1.0 + 0.75)).abs() < 1e-12);
366-
assert!((result.y - (-2.0 * 2.0 + 3.0 * -1.0)).abs() < 1e-12);
365+
assert!((result.x - (1.5 * 2.0 + 0.25 * 1.0 + 0.75)).abs() < 1e-12);
366+
assert!((result.y - (-2.0 * 2.0 - 3.0 * 1.0)).abs() < 1e-12);
367367
}
368368

369369
#[test]

src/user_defined.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ mod tests {
174174
let (x_out, y_out) = eq.eval(0.5, -2.0).unwrap();
175175

176176
assert!((x_out - (2.0 * 0.5 - 2.0)).abs() < 1e-12);
177-
assert!((y_out - (-1.0 * -2.0)).abs() < 1e-12);
177+
assert!((y_out - (1.0 * 2.0)).abs() < 1e-12);
178178
}
179179
}

0 commit comments

Comments
 (0)