style: apply cargo fmt across the crate (A20)
The repo never enforced rustfmt, so formatting had drifted broadly. This is a single mechanical `cargo fmt` pass over the whole crate (no behavioral change; lib suite green, 493 passed). Going forward fmt should be enforced (planned CI fmt --check step). Part of the 0.6.1 hygiene pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+20
-5
@@ -23,7 +23,10 @@ pub fn pan_gains(pan: f32) -> (f32, f32) {
|
||||
/// still following the same equal-power curve as a peer is moved away from center.
|
||||
pub fn playback_pan_gains(pan: f32) -> (f32, f32) {
|
||||
let (left, right) = pan_gains(pan);
|
||||
(left * std::f32::consts::SQRT_2, right * std::f32::consts::SQRT_2)
|
||||
(
|
||||
left * std::f32::consts::SQRT_2,
|
||||
right * std::f32::consts::SQRT_2,
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -36,8 +39,14 @@ mod tests {
|
||||
fn hard_left_and_right_are_endpoints() {
|
||||
assert_eq!(pan_gains(-1.0), (1.0, 0.0));
|
||||
let (l, r) = pan_gains(1.0);
|
||||
assert!(l.abs() < EPS, "left at hard-right should be zero-ish, got {l}");
|
||||
assert!((r - 1.0).abs() < EPS, "right at hard-right should be one, got {r}");
|
||||
assert!(
|
||||
l.abs() < EPS,
|
||||
"left at hard-right should be zero-ish, got {l}"
|
||||
);
|
||||
assert!(
|
||||
(r - 1.0).abs() < EPS,
|
||||
"right at hard-right should be one, got {r}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -55,8 +64,14 @@ mod tests {
|
||||
let mut prev_r = f32::NEG_INFINITY;
|
||||
for pan in pans {
|
||||
let (l, r) = pan_gains(pan);
|
||||
assert!(l <= prev_l + EPS, "left gain must not rise as pan moves right");
|
||||
assert!(r >= prev_r - EPS, "right gain must not fall as pan moves right");
|
||||
assert!(
|
||||
l <= prev_l + EPS,
|
||||
"left gain must not rise as pan moves right"
|
||||
);
|
||||
assert!(
|
||||
r >= prev_r - EPS,
|
||||
"right gain must not fall as pan moves right"
|
||||
);
|
||||
prev_l = l;
|
||||
prev_r = r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user