Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Update code for some new clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
crsaracco committed Nov 3, 2019
1 parent cee949e commit 72a6b1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/sine_synth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ impl Plugin for SineSynth {
}
}

#[allow(unknown_lints)]
#[allow(unused_variables)]
#[allow(clippy::single_match)]
fn process_events(&mut self, events: &Events) {
Expand Down
1 change: 0 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub struct AEffect {
impl AEffect {
/// Return handle to Plugin object. Only works for plugins created using this library.
// Supresses warning about returning a reference to a box
#[allow(unknown_lints)]
#[allow(clippy::borrowed_box)]
pub unsafe fn get_plugin(&mut self) -> &mut Box<dyn Plugin> {
//FIXME: find a way to do this without resorting to transmuting via a box
Expand Down
6 changes: 2 additions & 4 deletions src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,8 @@ impl<T: Float> HostBuffer<T> {
/// was created for, or if the sample arrays do not all have the same length.
pub fn bind<'a, I, O>(&'a mut self, input_arrays: &[I], output_arrays: &mut [O]) -> AudioBuffer<'a, T>
where
I: AsRef<[T]>,
O: AsMut<[T]>,
I: 'a,
O: 'a,
I: AsRef<[T]> + 'a,
O: AsMut<[T]> + 'a,
{
// Check that number of desired inputs and outputs fit in allocation
if input_arrays.len() > self.inputs.len() {
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ pub fn main<T: Plugin + Default>(callback: HostCallbackProc) -> *mut AEffect {
// Create a Box containing a zeroed AEffect. This is transmuted into a *mut pointer so that it
// can be passed into the HostCallback `wrap` method. The AEffect is then updated after the vst
// object is created so that the host still contains a raw pointer to the AEffect struct.
let effect = unsafe { Box::into_raw(Box::new(mem::zeroed::<AEffect>())) };
let effect = unsafe {
Box::into_raw(Box::new(mem::MaybeUninit::zeroed().assume_init()))
};

let host = HostCallback::wrap(callback, effect);
if host.vst_version() == 0 {
Expand Down
1 change: 1 addition & 0 deletions src/util/parameter_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ mod tests {
assert!(transfer.iterate(true).next().is_none());

// Verify final values
#[allow(clippy::needless_range_loop)]
for p in 0..PARAMETERS {
assert!((0..THREADS).any(|t| (results[t][p] - values[p]).abs() < std::f32::EPSILON));
}
Expand Down

0 comments on commit 72a6b1f

Please sign in to comment.