Skip to content

Commit c4c6de2

Browse files
committed
refactor: clippy fixes
1 parent ec8e9ef commit c4c6de2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mod test {
139139
/// - Practical audio range (-60dB to +40dB): max errors ~1x ε
140140
/// - Extended range (-100dB to +100dB): max errors ~2.3x ε
141141
/// - Extreme edge cases beyond ±100dB have larger errors but are rarely used
142-
142+
///
143143
/// Based on [Wikipedia's Decibel article].
144144
///
145145
/// [Wikipedia's Decibel article]: https://web.archive.org/web/20230810185300/https://en.wikipedia.org/wiki/Decibel

src/mixer.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ impl MixerSource {
177177
let mut pending = self.input.0.pending_sources.lock().unwrap(); // TODO: relax ordering?
178178

179179
for source in pending.drain(..) {
180-
let in_step = self.sample_count % source.channels().get() as usize == 0;
180+
let in_step = self
181+
.sample_count
182+
.is_multiple_of(source.channels().get() as usize);
181183

182184
if in_step {
183185
self.current_sources.push(source);

src/source/linear_ramp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ where
8888
factor = self.start_gain * (1.0f32 - p) + self.end_gain * p;
8989
}
9090

91-
if self.sample_idx % (self.channels().get() as u64) == 0 {
91+
if self.sample_idx.is_multiple_of(self.channels().get() as u64) {
9292
self.elapsed_ns += 1000000000.0 / (self.input.sample_rate().get() as f32);
9393
}
9494

0 commit comments

Comments
 (0)