Skip to content

Commit

Permalink
fix: compilation error in OHLCV::clv when value_type_f32 feature …
Browse files Browse the repository at this point in the history
…is enabled
  • Loading branch information
amv-dev committed Nov 11, 2023
1 parent 5b53293 commit d900239
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Run clippy
run: cargo clippy --tests --verbose
- name: Run clippy with features
run: cargo clippy --tests --verbose --features="value_type_f32,period_type_u64,unsafe_performance"
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run clippy
run: cargo clippy --tests --verbose
3 changes: 2 additions & 1 deletion src/core/ohlcv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ pub trait OHLCV: 'static {
if self.high() == self.low() {
0.
} else {
(2.0f64.mul_add(self.close(), -self.low()) - self.high()) / (self.high() - self.low())
let twice: ValueType = 2.;
(twice.mul_add(self.close(), -self.low()) - self.high()) / (self.high() - self.low())
}
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ limitations under the License.
#![allow(clippy::upper_case_acronyms)]
#![deny(clippy::nursery)]
#![allow(clippy::use_self)]
#![cfg_attr(feature = "period_type_u64", allow(clippy::cast_possible_truncation))]

//! Yet Another Technical Analysis library
//!
Expand Down

0 comments on commit d900239

Please sign in to comment.