style(bollinger): wrap naive helper assert to satisfy rustfmt
Commit aa2846c collapsed the multi-line assert in the test-only naive
helper to a single line to drop the cold expression-arg lines that
Codecov saw as uncovered. The single-line form exceeded the 100-col
limit, so cargo fmt --check failed on every supported toolchain in CI
(ubuntu-latest, macos-latest, windows-latest).
Let rustfmt wrap it back to the three-line form. The arms are still
just a literal expression and a static-string message — no expression
format args — so the cold-path lines that Codecov originally flagged
on line 179 stay covered. No behaviour change.
This commit is contained in:
@@ -173,7 +173,10 @@ mod tests {
|
||||
use approx::assert_relative_eq;
|
||||
|
||||
fn naive(prices: &[f64], period: usize, mult: f64) -> BollingerOutput {
|
||||
assert!(prices.len() >= period, "naive requires at least `period` prices");
|
||||
assert!(
|
||||
prices.len() >= period,
|
||||
"naive requires at least `period` prices"
|
||||
);
|
||||
let w = &prices[prices.len() - period..];
|
||||
let mean = w.iter().sum::<f64>() / period as f64;
|
||||
let var = w.iter().map(|x| (x - mean).powi(2)).sum::<f64>() / period as f64;
|
||||
|
||||
Reference in New Issue
Block a user