Skip to content

Commit

Permalink
Fix lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamiPerttu committed Nov 17, 2023
1 parent 8994a6d commit 22037ef
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
16 changes: 8 additions & 8 deletions src/audionode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ where
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -601,7 +601,7 @@ where
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -655,7 +655,7 @@ where
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -723,7 +723,7 @@ where
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -1124,7 +1124,7 @@ impl<N: Size<T>, T: Float> FrameAddScalar<N, T> {
pub fn new(scalar: T) -> Self {
Self {
scalar,
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -1159,7 +1159,7 @@ impl<N: Size<T>, T: Float> FrameMulScalar<N, T> {
pub fn new(scalar: T) -> Self {
Self {
scalar,
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ where
Self {
f,
routing,
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -2023,7 +2023,7 @@ where
{
pub fn new(x: Frame<X, N>) -> Self {
let mut node = MultiBus {
_marker: PhantomData::default(),
_marker: PhantomData,
x,
buffer: Buffer::new(),
};
Expand Down
2 changes: 1 addition & 1 deletion src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
sample_rate: T::zero(),
min_delay,
max_delay,
_marker: PhantomData::default(),
_marker: PhantomData,
};
node.set_sample_rate(DEFAULT_SR);
node
Expand Down
2 changes: 1 addition & 1 deletion src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ where
interval,
sample_duration: F::zero(),
hash: 0,
_marker: PhantomData::default(),
_marker: PhantomData,
};
node.set_sample_rate(sample_rate);
node.reset();
Expand Down
10 changes: 5 additions & 5 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl<T: Float, F: Real, N: Size<T>> ButterLowpass<T, F, N> {
/// Create new Butterworth lowpass filter with initial `cutoff` frequency in Hz.
pub fn new(cutoff: F) -> Self {
let mut node = ButterLowpass {
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
biquad: Biquad::new(),
sample_rate: F::from_f64(DEFAULT_SR),
cutoff: F::zero(),
Expand Down Expand Up @@ -256,7 +256,7 @@ impl<T: Float, F: Real, N: Size<T>> Resonator<T, F, N> {
/// Create new resonator bandpass. Initial `center` frequency and `bandwidth` are specified in Hz.
pub fn new(center: F, bandwidth: F) -> Self {
let mut node = Resonator {
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
biquad: Biquad::new(),
sample_rate: F::from_f64(DEFAULT_SR),
center,
Expand Down Expand Up @@ -343,7 +343,7 @@ impl<T: Float, F: Real, N: Size<T>> Lowpole<T, F, N> {
/// Create new lowpass filter. Cutoff frequency is specified in Hz.
pub fn new(cutoff: F) -> Self {
let mut node = Lowpole {
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
value: F::zero(),
coeff: F::zero(),
cutoff,
Expand Down Expand Up @@ -598,7 +598,7 @@ impl<T: Float, F: Float, N: Size<T>> Allpole<T, F, N> {
pub fn new(delay: F) -> Self {
assert!(delay > F::zero());
let mut node = Allpole {
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
eta: F::zero(),
x1: F::zero(),
y1: F::zero(),
Expand Down Expand Up @@ -681,7 +681,7 @@ impl<T: Float, F: Real, N: Size<T>> Highpole<T, F, N> {
/// Create new highpass filter. Initial `cutoff` frequency is specified in Hz.
pub fn new(cutoff: F) -> Self {
let mut node = Highpole {
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
x1: F::zero(),
y1: F::zero(),
coeff: F::zero(),
Expand Down
2 changes: 1 addition & 1 deletion src/oscillator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<T: Real, N: Size<T>> Dsf<T, N> {
harmonic_spacing,
sample_duration: T::zero(),
hash: 0,
_marker: PhantomData::default(),
_marker: PhantomData,
};
node.reset();
node.set_sample_rate(sample_rate);
Expand Down
2 changes: 1 addition & 1 deletion src/pan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<T: Real, N: Size<T>> Panner<T, N> {
pub fn new(value: T) -> Self {
let (left_weight, right_weight) = pan_weights(value);
Self {
_marker: PhantomData::default(),
_marker: PhantomData,
left_weight,
right_weight,
}
Expand Down
2 changes: 1 addition & 1 deletion src/rez.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<T: Float, F: Real, N: Size<T>> Rez<T, F, N> {
q,
sample_rate: convert(DEFAULT_SR),
bandpass,
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
};
node.set_cutoff_q(cutoff, q);
node
Expand Down
8 changes: 2 additions & 6 deletions src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Eq for Event64 {}
)]
impl PartialOrd for Event48 {
fn partial_cmp(&self, other: &Event48) -> Option<Ordering> {
other.start_time.partial_cmp(&self.start_time)
Some(self.cmp(other))
}
}

Expand All @@ -124,11 +124,7 @@ impl PartialOrd for Event48 {
)]
impl Ord for Event48 {
fn cmp(&self, other: &Self) -> Ordering {
if other.start_time > self.start_time {
Ordering::Less
} else {
Ordering::Greater
}
other.start_time.total_cmp(&self.start_time)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
pub fn new(f: S) -> Self {
Self {
f,
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@ pub enum Shape<T: Real> {
Tanh(T),
/// Apply `atan` distortion with configurable hardness.
/// Argument to `atan` is multiplied by the hardness value.
ATan(T),
Atan(T),
/// Apply `softsign` distortion with configurable hardness.
/// Argument to `softsign` is multiplied by the hardness value.
Softsign(T),
Expand Down Expand Up @@ -141,7 +141,7 @@ impl<T: Real> AudioNode for Shaper<T> {
Shape::Clip => [clamp11(input)].into(),
Shape::ClipTo(min, max) => [clamp(min, max, input)].into(),
Shape::Tanh(hardness) => [tanh(input * hardness)].into(),
Shape::ATan(hardness) => [atan(input * hardness)].into(),
Shape::Atan(hardness) => [atan(input * hardness)].into(),
Shape::Softsign(hardness) => [softsign(input * hardness)].into(),
Shape::Crush(levels) => [round(input * levels) / levels].into(),
Shape::SoftCrush(levels) => {
Expand Down Expand Up @@ -181,7 +181,7 @@ impl<T: Real> AudioNode for Shaper<T> {
*x = tanh(*y * hardness);
}
}
Shape::ATan(hardness) => {
Shape::Atan(hardness) => {
for (x, y) in output[0..size].iter_mut().zip(input[0..size].iter()) {
*x = atan(*y * hardness);
}
Expand Down
2 changes: 2 additions & 0 deletions src/slot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ impl SlotBackend48 {
}
}
/// We have faded to the next unit, now start fading to the latest unit, if any.
#[allow(clippy::needless_if)]
fn next_phase(&mut self) {
let mut next = self.next.take().unwrap();
std::mem::swap(&mut self.current, &mut next);
Expand All @@ -196,6 +197,7 @@ impl SlotBackend48 {
[ f32 ] [ Slot32 ] [ SlotMessage32 ] [ SlotBackend32 ] [ AudioUnit32 ];
)]
impl AudioUnit48 for SlotBackend48 {
#[allow(clippy::needless_if)]
fn reset(&mut self) {
// Adopt the latest configuration and reset the unit.
if let Some(mut latest) = self.latest.take() {
Expand Down
2 changes: 2 additions & 0 deletions src/snoop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl<T: Float> AudioNode for SnoopBackend<T> {
}

#[inline]
#[allow(clippy::needless_if)]
fn tick(
&mut self,
input: &Frame<Self::Sample, Self::Inputs>,
Expand All @@ -137,6 +138,7 @@ impl<T: Float> AudioNode for SnoopBackend<T> {
*input
}

#[allow(clippy::needless_if)]
fn process(
&mut self,
size: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/svf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ where
coeffs,
ic1eq: F::zero(),
ic2eq: F::zero(),
_marker: PhantomData::default(),
_marker: PhantomData,
}
}

Expand Down Expand Up @@ -992,7 +992,7 @@ where
coeffs,
ic1eq: F::zero(),
ic2eq: F::zero(),
_marker: PhantomData::default(),
_marker: PhantomData,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<T: Float, X: AudioNode, F: FnMut(T, T, &mut X) + Clone + Send + Sync> Syste
delta_time: T::zero(),
update_interval: dt,
sample_rate: T::from_f64(DEFAULT_SR),
_marker: PhantomData::default(),
_marker: PhantomData,
};
let hash = node.ping(true, AttoHash::new(Self::ID));
node.ping(false, hash);
Expand Down
2 changes: 1 addition & 1 deletion src/wave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ impl<T: Float> Wave48Player<T> {
start_point,
end_point,
loop_point,
_marker: PhantomData::default(),
_marker: PhantomData,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/wavetable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ where
initial_phase: 0.0,
table_hint: 0,
sample_rate: sample_rate as f32,
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
}
}
}
Expand Down Expand Up @@ -284,7 +284,7 @@ where
phase_ready: false,
table_hint: 0,
sample_rate: sample_rate as f32,
_marker: std::marker::PhantomData::default(),
_marker: std::marker::PhantomData,
}
}
}
Expand Down

0 comments on commit 22037ef

Please sign in to comment.