WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 82bcf07

Browse files
authored
Merge pull request #820 from RustAudio/style/unhide-rustfmt
style: rename rustfmt config and sync edition with 2021
2 parents 2effbfc + 7128455 commit 82bcf07

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

.rustfmt.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/limit_settings.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ fn main() {
6666
println!("Example 5: Comparing different limiting scenarios");
6767

6868
let gentle_limiting = LimitSettings::default()
69-
.with_threshold(-6.0) // Higher threshold (less limiting)
70-
.with_knee_width(8.0) // Wide knee (softer)
71-
.with_attack(Duration::from_millis(20)) // Slower attack
69+
.with_threshold(-6.0) // Higher threshold (less limiting)
70+
.with_knee_width(8.0) // Wide knee (softer)
71+
.with_attack(Duration::from_millis(20)) // Slower attack
7272
.with_release(Duration::from_millis(200)); // Slower release
7373

7474
let aggressive_limiting = LimitSettings::default()
75-
.with_threshold(-1.0) // Lower threshold (more limiting)
76-
.with_knee_width(1.0) // Narrow knee (harder)
77-
.with_attack(Duration::from_millis(2)) // Fast attack
75+
.with_threshold(-1.0) // Lower threshold (more limiting)
76+
.with_knee_width(1.0) // Narrow knee (harder)
77+
.with_attack(Duration::from_millis(2)) // Fast attack
7878
.with_release(Duration::from_millis(20)); // Fast release
7979

8080
println!(" Gentle limiting:");
@@ -109,8 +109,8 @@ fn main() {
109109
// Apply limiting with -6dB threshold (should limit to ~0.5)
110110
let strict_limiting = LimitSettings::default()
111111
.with_threshold(-6.0)
112-
.with_knee_width(0.5) // Narrow knee for precise limiting
113-
.with_attack(Duration::from_millis(3)) // Fast attack
112+
.with_knee_width(0.5) // Narrow knee for precise limiting
113+
.with_attack(Duration::from_millis(3)) // Fast attack
114114
.with_release(Duration::from_millis(12)); // Moderate release
115115

116116
let limited_sine = test_sine.limit(strict_limiting.clone());

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
edition = "2021"

src/sink.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ impl Sink {
138138
*to_clear -= 1;
139139
*controls.position.lock().unwrap() = Duration::ZERO;
140140
} else {
141-
*controls.position.lock().unwrap() = src.inner().inner().inner().inner().get_pos();
141+
*controls.position.lock().unwrap() =
142+
src.inner().inner().inner().inner().get_pos();
142143
}
143144
}
144145
let amp = src.inner_mut().inner_mut();

src/source/limit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ impl LimitSettings {
257257
#[inline]
258258
pub fn broadcast() -> Self {
259259
Self::default()
260-
.with_knee_width(2.0) // Narrower knee for decisive limiting
261-
.with_attack(Duration::from_millis(3)) // Faster attack for transients
260+
.with_knee_width(2.0) // Narrower knee for decisive limiting
261+
.with_attack(Duration::from_millis(3)) // Faster attack for transients
262262
.with_release(Duration::from_millis(50)) // Faster recovery for consistency
263263
}
264264

tests/limit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn test_limiting_works() {
1010
.take_duration(Duration::from_millis(60)); // ~2600 samples
1111

1212
let settings = rodio::source::LimitSettings::default()
13-
.with_threshold(-6.0) // -6dB = ~0.5 linear
13+
.with_threshold(-6.0) // -6dB = ~0.5 linear
1414
.with_knee_width(0.5)
1515
.with_attack(Duration::from_millis(3))
1616
.with_release(Duration::from_millis(12));

0 commit comments

Comments
 (0)