Fix CI workflow: use correct rust-toolchain action (#1)

* Fix CI workflow: use correct rust-toolchain action

* Fix CI: resolve Rust compilation and formatting issues
- Fix rust-toolchain action name in CI workflow
- Add missing Direction import in test modules
- Add missing entry_fees argument to open_position test calls
- Comment out nightly-only rustfmt options
- Auto-format code with cargo fmt
This commit is contained in:
vatsal
2026-01-28 15:38:31 +05:30
committed by GitHub
parent e6476b771f
commit 0f032dd39e
32 changed files with 193 additions and 660 deletions
+2 -12
View File
@@ -103,23 +103,13 @@ fn test_stochastic_range() {
// %K and %D should be in [0, 100]
for (i, &k) in result.k.iter().enumerate() {
if !k.is_nan() {
assert!(
k >= 0.0 && k <= 100.0,
"%K at index {} is out of range: {}",
i,
k
);
assert!(k >= 0.0 && k <= 100.0, "%K at index {} is out of range: {}", i, k);
}
}
for (i, &d) in result.d.iter().enumerate() {
if !d.is_nan() {
assert!(
d >= 0.0 && d <= 100.0,
"%D at index {} is out of range: {}",
i,
d
);
assert!(d >= 0.0 && d <= 100.0, "%D at index {} is out of range: {}", i, d);
}
}
}
+1 -6
View File
@@ -237,12 +237,7 @@ fn test_short_direction() {
let ohlcv = OhlcvData {
timestamps: (0..n as i64).collect(),
open: close
.iter()
.skip(1)
.chain(std::iter::once(&close[n - 1]))
.cloned()
.collect(),
open: close.iter().skip(1).chain(std::iter::once(&close[n - 1])).cloned().collect(),
high: close.iter().map(|c| c + 1.0).collect(),
low: close.iter().map(|c| c - 1.0).collect(),
close: close.clone(),