chore: apply rustfmt to binding/core sources and sync Cargo.lock

Normalises whitespace in sources committed earlier in this branch
before rustfmt was run over them (Node/WASM bindings, and three core
indicator test modules), and records the wasm-bindgen-test dependency
tree added in B6 into Cargo.lock. No functional change; cargo fmt --all
--check is now clean.
This commit is contained in:
kingchenc
2026-05-22 04:14:18 +02:00
parent 41d52ec5be
commit 59c435fbd5
6 changed files with 127 additions and 30 deletions
+21 -25
View File
@@ -299,12 +299,7 @@ impl StochNode {
})
}
#[napi]
pub fn update(
&mut self,
high: f64,
low: f64,
close: f64,
) -> napi::Result<Option<StochValue>> {
pub fn update(&mut self, high: f64, low: f64, close: f64) -> napi::Result<Option<StochValue>> {
Ok(self
.inner
.update(cnd(high, low, close, 0.0)?)
@@ -423,19 +418,15 @@ impl AdxNode {
})
}
#[napi]
pub fn update(
&mut self,
high: f64,
low: f64,
close: f64,
) -> napi::Result<Option<AdxValue>> {
Ok(self.inner.update(cnd(high, low, close, 0.0)?).map(|o| {
AdxValue {
pub fn update(&mut self, high: f64, low: f64, close: f64) -> napi::Result<Option<AdxValue>> {
Ok(self
.inner
.update(cnd(high, low, close, 0.0)?)
.map(|o| AdxValue {
plus_di: o.plus_di,
minus_di: o.minus_di,
adx: o.adx,
}
}))
}))
}
#[napi]
pub fn batch(
@@ -728,13 +719,14 @@ impl KeltnerNode {
low: f64,
close: f64,
) -> napi::Result<Option<KeltnerValue>> {
Ok(self.inner.update(cnd(high, low, close, 0.0)?).map(|o| {
KeltnerValue {
Ok(self
.inner
.update(cnd(high, low, close, 0.0)?)
.map(|o| KeltnerValue {
upper: o.upper,
middle: o.middle,
lower: o.lower,
}
}))
}))
}
#[napi]
pub fn batch(
@@ -794,13 +786,14 @@ impl DonchianNode {
}
#[napi]
pub fn update(&mut self, high: f64, low: f64) -> napi::Result<Option<DonchianValue>> {
Ok(self.inner.update(cnd(high, low, low, 0.0)?).map(|o| {
DonchianValue {
Ok(self
.inner
.update(cnd(high, low, low, 0.0)?)
.map(|o| DonchianValue {
upper: o.upper,
middle: o.middle,
lower: o.lower,
}
}))
}))
}
#[napi]
pub fn batch(&mut self, high: Vec<f64>, low: Vec<f64>) -> napi::Result<Vec<f64>> {
@@ -968,7 +961,10 @@ impl AroonNode {
Ok(self
.inner
.update(cnd(high, low, low, 0.0)?)
.map(|o| AroonValue { up: o.up, down: o.down }))
.map(|o| AroonValue {
up: o.up,
down: o.down,
}))
}
#[napi]
pub fn batch(&mut self, high: Vec<f64>, low: Vec<f64>) -> napi::Result<Vec<f64>> {
+6 -2
View File
@@ -442,7 +442,9 @@ impl WasmMfi {
volume: &[f64],
) -> Result<Float64Array, JsError> {
if high.len() != low.len() || low.len() != close.len() || close.len() != volume.len() {
return Err(JsError::new("high, low, close, volume must be equal length"));
return Err(JsError::new(
"high, low, close, volume must be equal length",
));
}
let mut out = Vec::with_capacity(high.len());
for i in 0..high.len() {
@@ -582,7 +584,9 @@ impl WasmVwap {
volume: &[f64],
) -> Result<Float64Array, JsError> {
if high.len() != low.len() || low.len() != close.len() || close.len() != volume.len() {
return Err(JsError::new("high, low, close, volume must be equal length"));
return Err(JsError::new(
"high, low, close, volume must be equal length",
));
}
let mut out = Vec::with_capacity(high.len());
for i in 0..high.len() {