diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 45e2070f..00000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,2 +0,0 @@ -reorder_imports = true -use_try_shorthand = true diff --git a/examples/limit_settings.rs b/examples/limit_settings.rs index 6b13065d..684c3e64 100644 --- a/examples/limit_settings.rs +++ b/examples/limit_settings.rs @@ -66,15 +66,15 @@ fn main() { println!("Example 5: Comparing different limiting scenarios"); let gentle_limiting = LimitSettings::default() - .with_threshold(-6.0) // Higher threshold (less limiting) - .with_knee_width(8.0) // Wide knee (softer) - .with_attack(Duration::from_millis(20)) // Slower attack + .with_threshold(-6.0) // Higher threshold (less limiting) + .with_knee_width(8.0) // Wide knee (softer) + .with_attack(Duration::from_millis(20)) // Slower attack .with_release(Duration::from_millis(200)); // Slower release let aggressive_limiting = LimitSettings::default() - .with_threshold(-1.0) // Lower threshold (more limiting) - .with_knee_width(1.0) // Narrow knee (harder) - .with_attack(Duration::from_millis(2)) // Fast attack + .with_threshold(-1.0) // Lower threshold (more limiting) + .with_knee_width(1.0) // Narrow knee (harder) + .with_attack(Duration::from_millis(2)) // Fast attack .with_release(Duration::from_millis(20)); // Fast release println!(" Gentle limiting:"); @@ -109,8 +109,8 @@ fn main() { // Apply limiting with -6dB threshold (should limit to ~0.5) let strict_limiting = LimitSettings::default() .with_threshold(-6.0) - .with_knee_width(0.5) // Narrow knee for precise limiting - .with_attack(Duration::from_millis(3)) // Fast attack + .with_knee_width(0.5) // Narrow knee for precise limiting + .with_attack(Duration::from_millis(3)) // Fast attack .with_release(Duration::from_millis(12)); // Moderate release let limited_sine = test_sine.limit(strict_limiting.clone()); diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..3a26366d --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +edition = "2021" diff --git a/src/sink.rs b/src/sink.rs index d72fbeb6..446c21bd 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -138,7 +138,8 @@ impl Sink { *to_clear -= 1; *controls.position.lock().unwrap() = Duration::ZERO; } else { - *controls.position.lock().unwrap() = src.inner().inner().inner().inner().get_pos(); + *controls.position.lock().unwrap() = + src.inner().inner().inner().inner().get_pos(); } } let amp = src.inner_mut().inner_mut(); diff --git a/src/source/limit.rs b/src/source/limit.rs index f3273cff..da4004a8 100644 --- a/src/source/limit.rs +++ b/src/source/limit.rs @@ -257,8 +257,8 @@ impl LimitSettings { #[inline] pub fn broadcast() -> Self { Self::default() - .with_knee_width(2.0) // Narrower knee for decisive limiting - .with_attack(Duration::from_millis(3)) // Faster attack for transients + .with_knee_width(2.0) // Narrower knee for decisive limiting + .with_attack(Duration::from_millis(3)) // Faster attack for transients .with_release(Duration::from_millis(50)) // Faster recovery for consistency } diff --git a/tests/limit.rs b/tests/limit.rs index 62434f97..e05babdb 100644 --- a/tests/limit.rs +++ b/tests/limit.rs @@ -10,7 +10,7 @@ fn test_limiting_works() { .take_duration(Duration::from_millis(60)); // ~2600 samples let settings = rodio::source::LimitSettings::default() - .with_threshold(-6.0) // -6dB = ~0.5 linear + .with_threshold(-6.0) // -6dB = ~0.5 linear .with_knee_width(0.5) .with_attack(Duration::from_millis(3)) .with_release(Duration::from_millis(12));