diff --git a/common/src/events/io/input.rs b/common/src/events/io/input.rs index 429df3ef..4053718b 100644 --- a/common/src/events/io/input.rs +++ b/common/src/events/io/input.rs @@ -262,7 +262,7 @@ impl<'a, I: InputEventBuffer> From<&'a I> for InputEvents<'a> { } } -impl<'a> InputEventBuffer for InputEvents<'a> { +impl InputEventBuffer for InputEvents<'_> { #[inline] fn len(&self) -> u32 { InputEvents::len(self) @@ -276,7 +276,7 @@ impl<'a> InputEventBuffer for InputEvents<'a> { const INDEX_ERROR: &str = "Indexed InputEvents list out of bounds"; -impl<'a> Index for InputEvents<'a> { +impl Index for InputEvents<'_> { type Output = UnknownEvent; #[inline] @@ -285,7 +285,7 @@ impl<'a> Index for InputEvents<'a> { } } -impl<'a> Debug for InputEvents<'a> { +impl Debug for InputEvents<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let mut list = f.debug_list(); for event in self { @@ -314,7 +314,7 @@ impl<'a> InputEventsIter<'a> { } } -impl<'a> Clone for InputEventsIter<'a> { +impl Clone for InputEventsIter<'_> { #[inline] fn clone(&self) -> Self { InputEventsIter { @@ -337,14 +337,14 @@ impl<'a> Iterator for InputEventsIter<'a> { } } -impl<'a> ExactSizeIterator for InputEventsIter<'a> { +impl ExactSizeIterator for InputEventsIter<'_> { #[inline] fn len(&self) -> usize { self.range.len() } } -impl<'a> DoubleEndedIterator for InputEventsIter<'a> { +impl DoubleEndedIterator for InputEventsIter<'_> { #[inline] fn next_back(&mut self) -> Option { self.range.next_back().and_then(|i| self.list.get(i)) diff --git a/common/src/events/io/merger.rs b/common/src/events/io/merger.rs index 10219eb1..cf90b5b8 100644 --- a/common/src/events/io/merger.rs +++ b/common/src/events/io/merger.rs @@ -14,7 +14,7 @@ pub struct EventMerger<'a, I1, I2> { started: bool, } -impl<'a, I1, I2> EventMerger<'a, I1, I2> { +impl EventMerger<'_, I1, I2> { /// Creates a new event merger from two iterators. #[inline] pub fn new(iter_1: I1, iter_2: I2) -> Self { diff --git a/common/src/events/io/output.rs b/common/src/events/io/output.rs index 43c38065..e958318b 100644 --- a/common/src/events/io/output.rs +++ b/common/src/events/io/output.rs @@ -167,7 +167,7 @@ impl<'a, I: OutputEventBuffer> From<&'a mut I> for OutputEvents<'a> { } } -impl<'a> OutputEventBuffer for OutputEvents<'a> { +impl OutputEventBuffer for OutputEvents<'_> { #[inline] fn try_push(&mut self, event: &UnknownEvent) -> Result<(), TryPushError> { OutputEvents::try_push(self, event) diff --git a/common/src/events/spaces/core.rs b/common/src/events/spaces/core.rs index 219c1df3..3e317e49 100644 --- a/common/src/events/spaces/core.rs +++ b/common/src/events/spaces/core.rs @@ -65,7 +65,7 @@ unsafe impl<'a> EventSpace<'a> for CoreEventSpace<'a> { } } -impl<'a> Debug for CoreEventSpace<'a> { +impl Debug for CoreEventSpace<'_> { #[inline] fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { diff --git a/common/src/events/spaces/id.rs b/common/src/events/spaces/id.rs index 6809b4c0..5a1d4d98 100644 --- a/common/src/events/spaces/id.rs +++ b/common/src/events/spaces/id.rs @@ -50,7 +50,7 @@ impl<'a, S: EventSpace<'a>> From> for EventSpaceId<()> { } } -impl<'a> EventSpaceId> { +impl EventSpaceId> { #[inline] pub const fn core() -> Self { Self { diff --git a/common/src/stream.rs b/common/src/stream.rs index e58c3e9e..3a52516f 100644 --- a/common/src/stream.rs +++ b/common/src/stream.rs @@ -65,7 +65,7 @@ impl<'a> InputStream<'a> { } } -impl<'a> Read for InputStream<'a> { +impl Read for InputStream<'_> { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { let ret = if let Some(read) = self.0.read { // SAFETY: this function pointer is guaranteed to be valid by from_raw_mut and from_reader @@ -115,7 +115,7 @@ impl<'a> OutputStream<'a> { } } -impl<'a> Write for OutputStream<'a> { +impl Write for OutputStream<'_> { fn write(&mut self, buf: &[u8]) -> std::io::Result { let ret = if let Some(write) = self.0.write { // SAFETY: this function pointer is guaranteed to be valid by from_raw_mut and from_reader diff --git a/extensions/src/audio_ports.rs b/extensions/src/audio_ports.rs index 272076e7..51653ccd 100644 --- a/extensions/src/audio_ports.rs +++ b/extensions/src/audio_ports.rs @@ -16,7 +16,7 @@ pub struct HostAudioPorts(RawExtension #[derive(Copy, Clone, Eq, PartialEq, Debug)] pub struct AudioPortType<'a>(pub &'a CStr); -impl<'a> AudioPortType<'a> { +impl AudioPortType<'_> { pub const MONO: AudioPortType<'static> = AudioPortType(CLAP_PORT_MONO); pub const STEREO: AudioPortType<'static> = AudioPortType(CLAP_PORT_STEREO); @@ -126,7 +126,7 @@ impl<'a> AudioPortInfo<'a> { } } -impl<'a> Debug for AudioPortInfo<'a> { +impl Debug for AudioPortInfo<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("AudioPortInfoData") .field("id", &self.id) diff --git a/extensions/src/audio_ports/plugin.rs b/extensions/src/audio_ports/plugin.rs index 31b5515a..dc8c395d 100644 --- a/extensions/src/audio_ports/plugin.rs +++ b/extensions/src/audio_ports/plugin.rs @@ -10,7 +10,7 @@ pub struct AudioPortInfoWriter<'a> { is_set: bool, } -impl<'a> AudioPortInfoWriter<'a> { +impl AudioPortInfoWriter<'_> { /// # Safety /// /// The user must ensure the provided pointer is aligned and points to a valid allocation. diff --git a/extensions/src/audio_ports_config.rs b/extensions/src/audio_ports_config.rs index dc48c9ed..bb8a0c2d 100644 --- a/extensions/src/audio_ports_config.rs +++ b/extensions/src/audio_ports_config.rs @@ -119,7 +119,7 @@ pub struct MainPortInfo<'a> { } #[cfg(feature = "clack-host")] -impl<'a> MainPortInfo<'a> { +impl MainPortInfo<'_> { /// # Safety /// /// User must make sure port_type is either null or points to a NULL-terminated C string that diff --git a/extensions/src/audio_ports_config/plugin.rs b/extensions/src/audio_ports_config/plugin.rs index ecd634a3..c32653a1 100644 --- a/extensions/src/audio_ports_config/plugin.rs +++ b/extensions/src/audio_ports_config/plugin.rs @@ -95,7 +95,7 @@ pub struct AudioPortConfigWriter<'a> { is_set: bool, } -impl<'a> AudioPortConfigWriter<'a> { +impl AudioPortConfigWriter<'_> { /// # Safety /// /// The user must ensure the provided pointer is aligned and points to a valid allocation. diff --git a/extensions/src/gui.rs b/extensions/src/gui.rs index 68ce3ae2..e358e22d 100644 --- a/extensions/src/gui.rs +++ b/extensions/src/gui.rs @@ -333,7 +333,7 @@ pub struct GuiConfiguration<'a> { #[derive(Copy, Clone, PartialEq, Eq)] pub struct GuiApiType<'a>(pub &'a CStr); -impl<'a> GuiApiType<'a> { +impl GuiApiType<'_> { /// Represents the Win32 API used by Windows. /// /// This API uses physical size for pixels. @@ -454,7 +454,7 @@ impl<'a> GuiApiType<'a> { } } -impl<'a> Debug for GuiApiType<'a> { +impl Debug for GuiApiType<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self.0.to_str() { Ok(s) => f.write_str(s), diff --git a/extensions/src/gui/window.rs b/extensions/src/gui/window.rs index 80cbaccb..a2768d60 100644 --- a/extensions/src/gui/window.rs +++ b/extensions/src/gui/window.rs @@ -163,7 +163,7 @@ const _: () = { }; // SAFETY: this type ensures the handles are valid and are consistent across calls - unsafe impl<'a> HasRawWindowHandle for Window<'a> { + unsafe impl HasRawWindowHandle for Window<'_> { fn raw_window_handle(&self) -> RawWindowHandle { let api_type = self.api_type(); @@ -223,7 +223,7 @@ const _: () = { use std::ptr::NonNull; // SAFETY: The host ensures the underlying window handles are still valid - unsafe impl<'a> HasRawWindowHandle for Window<'a> { + unsafe impl HasRawWindowHandle for Window<'_> { fn raw_window_handle(&self) -> Result { let api_type = self.api_type(); diff --git a/extensions/src/note_name/plugin.rs b/extensions/src/note_name/plugin.rs index d6946aa3..41ba17c0 100644 --- a/extensions/src/note_name/plugin.rs +++ b/extensions/src/note_name/plugin.rs @@ -64,7 +64,7 @@ pub struct NoteNameWriter<'a> { is_set: bool, } -impl<'a> NoteNameWriter<'a> { +impl NoteNameWriter<'_> { /// # Safety /// /// The user must ensure the provided pointer is aligned and points to a valid allocation. diff --git a/extensions/src/note_ports/plugin.rs b/extensions/src/note_ports/plugin.rs index 104a7a0f..c9000fb0 100644 --- a/extensions/src/note_ports/plugin.rs +++ b/extensions/src/note_ports/plugin.rs @@ -9,7 +9,7 @@ pub struct NotePortInfoWriter<'a> { is_set: bool, } -impl<'a> NotePortInfoWriter<'a> { +impl NotePortInfoWriter<'_> { /// # Safety /// /// The user must ensure the provided pointer is aligned and points to a valid allocation. diff --git a/extensions/src/params/plugin.rs b/extensions/src/params/plugin.rs index 8c22cb02..9fc589ad 100644 --- a/extensions/src/params/plugin.rs +++ b/extensions/src/params/plugin.rs @@ -12,7 +12,7 @@ pub struct ParamInfoWriter<'a> { is_set: bool, } -impl<'a> ParamInfoWriter<'a> { +impl ParamInfoWriter<'_> { /// # Safety /// /// The user must ensure the provided pointer is aligned and points to a valid allocation. @@ -78,7 +78,7 @@ impl<'a> ParamDisplayWriter<'a> { } } -impl<'a> core::fmt::Write for ParamDisplayWriter<'a> { +impl core::fmt::Write for ParamDisplayWriter<'_> { fn write_str(&mut self, s: &str) -> core::fmt::Result { let s = s.as_bytes(); let requested_len = core::cmp::min(s.len(), self.remaining_len()); diff --git a/host/examples/cpal/src/host.rs b/host/examples/cpal/src/host.rs index c9d2cb78..379daeca 100644 --- a/host/examples/cpal/src/host.rs +++ b/host/examples/cpal/src/host.rs @@ -353,7 +353,7 @@ impl HostLogImpl for CpalHostShared { } } -impl<'a> HostAudioPortsImpl for CpalHostMainThread<'a> { +impl HostAudioPortsImpl for CpalHostMainThread<'_> { fn is_rescan_flag_supported(&self, _flag: RescanType) -> bool { false } @@ -363,7 +363,7 @@ impl<'a> HostAudioPortsImpl for CpalHostMainThread<'a> { } } -impl<'a> HostNotePortsImpl for CpalHostMainThread<'a> { +impl HostNotePortsImpl for CpalHostMainThread<'_> { fn supported_dialects(&self) -> NoteDialects { NoteDialects::CLAP } @@ -373,7 +373,7 @@ impl<'a> HostNotePortsImpl for CpalHostMainThread<'a> { } } -impl<'a> HostParamsImplMainThread for CpalHostMainThread<'a> { +impl HostParamsImplMainThread for CpalHostMainThread<'_> { fn rescan(&mut self, _flags: ParamRescanFlags) { // We don't track param values at all } diff --git a/host/examples/cpal/src/host/gui.rs b/host/examples/cpal/src/host/gui.rs index 434173fc..1bee0f2d 100644 --- a/host/examples/cpal/src/host/gui.rs +++ b/host/examples/cpal/src/host/gui.rs @@ -34,7 +34,7 @@ impl HostGuiImpl for CpalHostShared { } } -impl<'a> CpalHostMainThread<'a> {} +impl CpalHostMainThread<'_> {} /// Tracks a plugin's GUI state and configuration. pub struct Gui { diff --git a/host/examples/cpal/src/host/timer.rs b/host/examples/cpal/src/host/timer.rs index 76d22740..b622b1fe 100644 --- a/host/examples/cpal/src/host/timer.rs +++ b/host/examples/cpal/src/host/timer.rs @@ -5,7 +5,7 @@ use std::cell::{Cell, RefCell}; use std::collections::HashMap; use std::time::{Duration, Instant}; -impl<'a> HostTimerImpl for CpalHostMainThread<'a> { +impl HostTimerImpl for CpalHostMainThread<'_> { fn register_timer(&mut self, period_ms: u32) -> Result { Ok(self .timers diff --git a/host/src/bundle/diva_stub.rs b/host/src/bundle/diva_stub.rs index 43edb4ac..6ccae9bf 100644 --- a/host/src/bundle/diva_stub.rs +++ b/host/src/bundle/diva_stub.rs @@ -1,3 +1,5 @@ +#![allow(missing_docs)] + use clack_plugin::clack_entry; use clack_plugin::prelude::*; diff --git a/host/src/host.rs b/host/src/host.rs index b941295f..85616872 100644 --- a/host/src/host.rs +++ b/host/src/host.rs @@ -318,9 +318,9 @@ pub trait HostHandlers: 'static { // QoL implementations -impl<'a> AudioProcessorHandler<'a> for () {} -impl<'a> MainThreadHandler<'a> for () {} -impl<'a> SharedHandler<'a> for () { +impl AudioProcessorHandler<'_> for () {} +impl MainThreadHandler<'_> for () {} +impl SharedHandler<'_> for () { fn request_restart(&self) {} fn request_process(&self) {} fn request_callback(&self) {} diff --git a/host/src/plugin/handle.rs b/host/src/plugin/handle.rs index 8ff773e3..03b89a94 100644 --- a/host/src/plugin/handle.rs +++ b/host/src/plugin/handle.rs @@ -84,9 +84,9 @@ pub struct PluginSharedHandle<'a> { } // SAFETY: The Shared handle only exposes thread-safe methods -unsafe impl<'a> Send for PluginSharedHandle<'a> {} +unsafe impl Send for PluginSharedHandle<'_> {} // SAFETY: The Shared handle only exposes thread-safe methods -unsafe impl<'a> Sync for PluginSharedHandle<'a> {} +unsafe impl Sync for PluginSharedHandle<'_> {} impl<'a> PluginSharedHandle<'a> { /// # Safety @@ -181,7 +181,7 @@ pub struct PluginAudioProcessorHandle<'a> { } // SAFETY: This type only exposes audio-thread methods -unsafe impl<'a> Send for PluginAudioProcessorHandle<'a> {} +unsafe impl Send for PluginAudioProcessorHandle<'_> {} impl<'a> PluginAudioProcessorHandle<'a> { pub(crate) fn new(raw: NonNull) -> Self { diff --git a/host/tests/call-in-destruction.rs b/host/tests/call-in-destruction.rs index 3c8583c3..093e54d6 100644 --- a/host/tests/call-in-destruction.rs +++ b/host/tests/call-in-destruction.rs @@ -26,7 +26,7 @@ struct MyPluginMainThread { data: String, } -impl<'a> PluginMainThread<'a, ()> for MyPluginMainThread {} +impl PluginMainThread<'_, ()> for MyPluginMainThread {} impl PluginStateImpl for MyPluginMainThread { fn save(&mut self, output: &mut OutputStream) -> Result<(), PluginError> { @@ -99,7 +99,7 @@ impl<'a> MainThreadHandler<'a> for MyHostMainThread<'a> { } } -impl<'a> Drop for MyHostMainThread<'a> { +impl Drop for MyHostMainThread<'_> { fn drop(&mut self) { let instance = self.instance.as_ref().unwrap(); assert!(instance.get_extension::().is_none()); diff --git a/host/tests/drop.rs b/host/tests/drop.rs index fadd9730..0e0f0a04 100644 --- a/host/tests/drop.rs +++ b/host/tests/drop.rs @@ -17,7 +17,7 @@ pub struct DivaPluginStubMainThread { active: bool, } -impl<'a> PluginMainThread<'a, ()> for DivaPluginStubMainThread {} +impl PluginMainThread<'_, ()> for DivaPluginStubMainThread {} impl Plugin for DivaPluginStub { type AudioProcessor<'a> = DivaPluginStubAudioProcessor; @@ -105,7 +105,7 @@ impl Drop for DivaPluginStubMainThread { pub static DIVA_STUB_ENTRY: EntryDescriptor = clack_entry!(SinglePluginEntry); struct MyHostShared; -impl<'a> SharedHandler<'a> for MyHostShared { +impl SharedHandler<'_> for MyHostShared { fn request_restart(&self) { unreachable!() } diff --git a/host/tests/instance.rs b/host/tests/instance.rs index 92f703c4..c234c78d 100644 --- a/host/tests/instance.rs +++ b/host/tests/instance.rs @@ -10,7 +10,7 @@ pub struct DivaPluginStubAudioProcessor; pub struct DivaPluginStub; pub struct DivaPluginStubMainThread; -impl<'a> PluginMainThread<'a, ()> for DivaPluginStubMainThread {} +impl PluginMainThread<'_, ()> for DivaPluginStubMainThread {} impl Plugin for DivaPluginStub { type AudioProcessor<'a> = DivaPluginStubAudioProcessor; @@ -60,7 +60,7 @@ impl<'a> PluginAudioProcessor<'a, (), DivaPluginStubMainThread> for DivaPluginSt pub static DIVA_STUB_ENTRY: EntryDescriptor = clack_entry!(SinglePluginEntry); struct MyHostShared; -impl<'a> SharedHandler<'a> for MyHostShared { +impl SharedHandler<'_> for MyHostShared { fn request_restart(&self) { unreachable!() } diff --git a/host/tests/reentrant-init.rs b/host/tests/reentrant-init.rs index ee78c678..0ccdf599 100644 --- a/host/tests/reentrant-init.rs +++ b/host/tests/reentrant-init.rs @@ -20,7 +20,7 @@ impl Plugin for MyPlugin { struct MyPluginMainThread; -impl<'a> PluginMainThread<'a, ()> for MyPluginMainThread {} +impl PluginMainThread<'_, ()> for MyPluginMainThread {} impl PluginTimerImpl for MyPluginMainThread { fn on_timer(&mut self, timer_id: TimerId) { @@ -91,7 +91,7 @@ impl<'a> MainThreadHandler<'a> for MyHostMainThread<'a> { fn initialized(&mut self, _instance: InitializedPluginHandle<'a>) {} } -impl<'a> HostTimerImpl for MyHostMainThread<'a> { +impl HostTimerImpl for MyHostMainThread<'_> { fn register_timer(&mut self, period_ms: u32) -> Result { assert_eq!(period_ms, 1000); diff --git a/host/tests/shared-state.rs b/host/tests/shared-state.rs index 938703cf..8739fb0e 100644 --- a/host/tests/shared-state.rs +++ b/host/tests/shared-state.rs @@ -8,7 +8,7 @@ pub struct DivaPluginStubAudioProcessor; pub struct DivaPluginStub; pub struct DivaPluginStubMainThread; -impl<'a> PluginMainThread<'a, ()> for DivaPluginStubMainThread {} +impl PluginMainThread<'_, ()> for DivaPluginStubMainThread {} impl Plugin for DivaPluginStub { type AudioProcessor<'a> = DivaPluginStubAudioProcessor; diff --git a/plugin/examples/gain/src/lib.rs b/plugin/examples/gain/src/lib.rs index 0ce12590..8ca630f4 100644 --- a/plugin/examples/gain/src/lib.rs +++ b/plugin/examples/gain/src/lib.rs @@ -131,7 +131,7 @@ impl<'a> PluginAudioProcessor<'a, GainPluginShared, GainPluginMainThread<'a>> } } -impl<'a> PluginAudioPortsImpl for GainPluginMainThread<'a> { +impl PluginAudioPortsImpl for GainPluginMainThread<'_> { fn count(&mut self, _is_input: bool) -> u32 { 1 } @@ -156,7 +156,7 @@ pub struct GainPluginShared { params: GainParams, } -impl<'a> PluginShared<'a> for GainPluginShared {} +impl PluginShared<'_> for GainPluginShared {} /// The data that belongs to the main thread of our plugin. pub struct GainPluginMainThread<'a> { diff --git a/plugin/examples/gain/src/params.rs b/plugin/examples/gain/src/params.rs index 810f92b0..c1681894 100644 --- a/plugin/examples/gain/src/params.rs +++ b/plugin/examples/gain/src/params.rs @@ -68,7 +68,7 @@ impl GainParams { /// /// Our state "serialization" is extremely simple and basic: we only have the value of the /// volume parameter to store, so we just store its bytes (in little-endian) and call it a day. -impl<'a> PluginStateImpl for GainPluginMainThread<'a> { +impl PluginStateImpl for GainPluginMainThread<'_> { fn save(&mut self, output: &mut OutputStream) -> Result<(), PluginError> { let volume_param = self.shared.params.get_volume(); @@ -85,7 +85,7 @@ impl<'a> PluginStateImpl for GainPluginMainThread<'a> { } } -impl<'a> PluginMainThreadParams for GainPluginMainThread<'a> { +impl PluginMainThreadParams for GainPluginMainThread<'_> { fn count(&mut self) -> u32 { 1 } @@ -150,7 +150,7 @@ impl<'a> PluginMainThreadParams for GainPluginMainThread<'a> { } } -impl<'a> PluginAudioProcessorParams for GainPluginAudioProcessor<'a> { +impl PluginAudioProcessorParams for GainPluginAudioProcessor<'_> { fn flush( &mut self, input_parameter_changes: &InputEvents, diff --git a/plugin/examples/gain/tests/test_gain.rs b/plugin/examples/gain/tests/test_gain.rs index fb624bc0..79d3bcbd 100644 --- a/plugin/examples/gain/tests/test_gain.rs +++ b/plugin/examples/gain/tests/test_gain.rs @@ -143,7 +143,7 @@ struct TestHostShared; struct TestHostAudioProcessor; struct TestHostHandlers; -impl<'a> SharedHandler<'a> for TestHostShared { +impl SharedHandler<'_> for TestHostShared { fn request_restart(&self) { unimplemented!() } @@ -157,9 +157,9 @@ impl<'a> SharedHandler<'a> for TestHostShared { } } -impl<'a> AudioProcessorHandler<'a> for TestHostAudioProcessor {} +impl AudioProcessorHandler<'_> for TestHostAudioProcessor {} -impl<'a> MainThreadHandler<'a> for TestHostMainThread {} +impl MainThreadHandler<'_> for TestHostMainThread {} impl HostHandlers for TestHostHandlers { type Shared<'a> = TestHostShared; diff --git a/plugin/examples/polysynth/src/lib.rs b/plugin/examples/polysynth/src/lib.rs index 58fa287c..e4ddf17c 100644 --- a/plugin/examples/polysynth/src/lib.rs +++ b/plugin/examples/polysynth/src/lib.rs @@ -154,7 +154,7 @@ impl<'a> PluginAudioProcessor<'a, PolySynthPluginShared, PolySynthPluginMainThre } } -impl<'a> PolySynthAudioProcessor<'a> { +impl PolySynthAudioProcessor<'_> { /// Handles an incoming event. fn handle_event(&mut self, event: &UnknownEvent) { match event.as_core_event() { @@ -181,7 +181,7 @@ impl<'a> PolySynthAudioProcessor<'a> { } } -impl<'a> PluginAudioPortsImpl for PolySynthPluginMainThread<'a> { +impl PluginAudioPortsImpl for PolySynthPluginMainThread<'_> { fn count(&mut self, is_input: bool) -> u32 { if is_input { 0 @@ -204,7 +204,7 @@ impl<'a> PluginAudioPortsImpl for PolySynthPluginMainThread<'a> { } } -impl<'a> PluginNotePortsImpl for PolySynthPluginMainThread<'a> { +impl PluginNotePortsImpl for PolySynthPluginMainThread<'_> { fn count(&mut self, is_input: bool) -> u32 { if is_input { 1 @@ -231,7 +231,7 @@ pub struct PolySynthPluginShared { params: PolySynthParams, } -impl<'a> PluginShared<'a> for PolySynthPluginShared {} +impl PluginShared<'_> for PolySynthPluginShared {} /// The data that belongs to the main thread of our plugin. pub struct PolySynthPluginMainThread<'a> { diff --git a/plugin/examples/polysynth/src/params.rs b/plugin/examples/polysynth/src/params.rs index d4d1b5c2..f2ef8975 100644 --- a/plugin/examples/polysynth/src/params.rs +++ b/plugin/examples/polysynth/src/params.rs @@ -101,7 +101,7 @@ impl PolySynthParamModulations { /// /// Our state "serialization" is extremely simple and basic: we only have the value of the /// volume parameter to store, so we just store its bytes (in little-endian) and call it a day. -impl<'a> PluginStateImpl for PolySynthPluginMainThread<'a> { +impl PluginStateImpl for PolySynthPluginMainThread<'_> { fn save(&mut self, output: &mut OutputStream) -> Result<(), PluginError> { let volume_param = self.shared.params.get_volume(); @@ -118,7 +118,7 @@ impl<'a> PluginStateImpl for PolySynthPluginMainThread<'a> { } } -impl<'a> PluginMainThreadParams for PolySynthPluginMainThread<'a> { +impl PluginMainThreadParams for PolySynthPluginMainThread<'_> { fn count(&mut self) -> u32 { 1 } @@ -189,7 +189,7 @@ impl<'a> PluginMainThreadParams for PolySynthPluginMainThread<'a> { } } -impl<'a> PluginAudioProcessorParams for PolySynthAudioProcessor<'a> { +impl PluginAudioProcessorParams for PolySynthAudioProcessor<'_> { fn flush( &mut self, input_parameter_changes: &InputEvents, diff --git a/plugin/src/extensions/wrapper.rs b/plugin/src/extensions/wrapper.rs index 371d462b..7ef1558a 100644 --- a/plugin/src/extensions/wrapper.rs +++ b/plugin/src/extensions/wrapper.rs @@ -159,7 +159,7 @@ impl<'a, P: Plugin> PluginWrapper<'a, P> { /// Besides providing a reference, this function does a few extra safety checks: /// /// * The given `clap_plugin` pointer is null-checked, as well as some other host-provided - /// pointers; + /// pointers; /// * The handler is wrapped in [`std::panic::catch_unwind`]; /// * Any [`PluginWrapperError`] returned by the handler is caught. /// @@ -279,10 +279,10 @@ impl<'a, P: Plugin> PluginWrapper<'a, P> { // SAFETY: the wrapper itself can be shared and used across threads, accessing any inner part that // isn't requires unsafe. -unsafe impl<'a, P: Plugin> Send for PluginWrapper<'a, P> {} +unsafe impl Send for PluginWrapper<'_, P> {} // SAFETY: the wrapper itself can be shared and used across threads, accessing any inner part that // isn't requires unsafe. -unsafe impl<'a, P: Plugin> Sync for PluginWrapper<'a, P> {} +unsafe impl Sync for PluginWrapper<'_, P> {} /// Errors raised by a [`PluginWrapper`]. #[derive(Debug)] diff --git a/plugin/src/host.rs b/plugin/src/host.rs index 5c31370c..779d07f3 100644 --- a/plugin/src/host.rs +++ b/plugin/src/host.rs @@ -134,9 +134,9 @@ pub struct HostSharedHandle<'a> { } // SAFETY: this type only safely exposes the thread-safe operations of clap_host -unsafe impl<'a> Send for HostSharedHandle<'a> {} +unsafe impl Send for HostSharedHandle<'_> {} // SAFETY: this type only safely exposes the thread-safe operations of clap_host -unsafe impl<'a> Sync for HostSharedHandle<'a> {} +unsafe impl Sync for HostSharedHandle<'_> {} impl<'a> HostSharedHandle<'a> { /// Returns the host's information. @@ -317,7 +317,7 @@ pub struct HostAudioProcessorHandle<'a> { } // SAFETY: this type only exposes the audio-thread-safe (Send) operation of clap_host -unsafe impl<'a> Send for HostAudioProcessorHandle<'a> {} +unsafe impl Send for HostAudioProcessorHandle<'_> {} impl<'a> HostAudioProcessorHandle<'a> { /// Gets a thread-safe host handle from this handle. diff --git a/plugin/src/plugin.rs b/plugin/src/plugin.rs index fa157cd0..9efa065e 100644 --- a/plugin/src/plugin.rs +++ b/plugin/src/plugin.rs @@ -10,8 +10,8 @@ //! audio processing thread, those happening in the main thread, and thread-safe operations: //! //! * The *audio thread* (`[audio-thread]` in the CLAP specification): this is represented by a type -//! implementing the main [`PluginAudioProcessor`] trait (also named the audio processor), which is [`Send`] but -//! [`!Sync`](Sync), and is the only one required to implement a Clack plugin. +//! implementing the main [`PluginAudioProcessor`] trait (also named the audio processor), which is [`Send`] but +//! [`!Sync`](Sync), and is the only one required to implement a Clack plugin. //! //! This type handles all DSP in one of the host's audio threads, of which there may be //! multiple, if the host uses a thread pool for example. @@ -72,7 +72,7 @@ pub use clack_common::plugin::*; /// See the [module documentation](crate::plugin) for more information on the thread model. pub trait PluginShared<'a>: Sized + Send + Sync + 'a {} -impl<'a> PluginShared<'a> for () {} +impl PluginShared<'_> for () {} /// The part of the data and operation of a plugin that must be on the main thread. /// diff --git a/plugin/src/plugin/instance.rs b/plugin/src/plugin/instance.rs index cd437900..d0c28b7a 100644 --- a/plugin/src/plugin/instance.rs +++ b/plugin/src/plugin/instance.rs @@ -18,7 +18,7 @@ pub(crate) trait PluginInitializer<'a, P: Plugin>: 'a { fn init( self: Box, host: HostMainThreadHandle<'a>, - ) -> Result, PluginError>; + ) -> Result, PluginError>; } impl<'a, P: Plugin, FS: 'a, FM: 'a> PluginInitializer<'a, P> for (FS, FM) @@ -32,7 +32,7 @@ where fn init( self: Box, host: HostMainThreadHandle<'a>, - ) -> Result, PluginError> { + ) -> Result, PluginError> { let (shared_initializer, main_thread_initializer) = *self; let shared_handle = host.shared(); let shared = Box::pin(shared_initializer(shared_handle)?); @@ -54,7 +54,7 @@ where fn init( self: Box, host: HostMainThreadHandle<'a>, - ) -> Result, PluginError> { + ) -> Result, PluginError> { let shared_handle = host.shared(); let (shared, main_thread_initializer) = self(host)?; let shared = Box::pin(shared); @@ -469,7 +469,7 @@ impl<'a> PluginInstance<'a> { } // In case the instance is dropped by a faulty plugin factory implementation. -impl<'a> Drop for PluginInstance<'a> { +impl Drop for PluginInstance<'_> { #[inline] fn drop(&mut self) { if let Some(destroy) = self.inner.destroy { diff --git a/plugin/src/process.rs b/plugin/src/process.rs index a92580bc..543b1bea 100644 --- a/plugin/src/process.rs +++ b/plugin/src/process.rs @@ -71,7 +71,7 @@ pub struct Events<'a> { pub output: &'a mut OutputEvents<'a>, } -impl<'a> Events<'a> { +impl Events<'_> { /// # Safety /// /// The user must ensure the given process struct is fully valid, and for the lifetime `'a`. diff --git a/plugin/src/process/audio.rs b/plugin/src/process/audio.rs index f619800f..4bc1b3f5 100644 --- a/plugin/src/process/audio.rs +++ b/plugin/src/process/audio.rs @@ -13,6 +13,7 @@ pub use pair::*; pub use sample_type::SampleType; #[cfg(test)] +#[allow(missing_docs)] pub mod tests { use super::*; use crate::prelude::Audio; diff --git a/plugin/src/process/audio/input.rs b/plugin/src/process/audio/input.rs index 5b9b2a28..db590e1c 100644 --- a/plugin/src/process/audio/input.rs +++ b/plugin/src/process/audio/input.rs @@ -39,7 +39,7 @@ impl<'a> Iterator for InputPortsIter<'a> { } } -impl<'a> ExactSizeIterator for InputPortsIter<'a> { +impl ExactSizeIterator for InputPortsIter<'_> { #[inline] fn len(&self) -> usize { self.inputs.len() @@ -243,7 +243,7 @@ impl<'a, T> Iterator for InputChannelsIter<'a, T> { } } -impl<'a, S> ExactSizeIterator for InputChannelsIter<'a, S> { +impl ExactSizeIterator for InputChannelsIter<'_, S> { #[inline] fn len(&self) -> usize { self.data.len() diff --git a/plugin/src/process/audio/output.rs b/plugin/src/process/audio/output.rs index 27b6d56d..9cbe310c 100644 --- a/plugin/src/process/audio/output.rs +++ b/plugin/src/process/audio/output.rs @@ -40,7 +40,7 @@ impl<'a> Iterator for OutputPortsIter<'a> { } } -impl<'a> ExactSizeIterator for OutputPortsIter<'a> { +impl ExactSizeIterator for OutputPortsIter<'_> { #[inline] fn len(&self) -> usize { self.outputs.len() @@ -156,7 +156,7 @@ pub struct OutputChannels<'a, S> { pub(crate) data: &'a mut [*mut S], } -impl<'a, S> OutputChannels<'a, S> { +impl OutputChannels<'_, S> { /// Returns the number of frames to process in this block. /// /// This will always match the number of samples of every audio channel buffer. @@ -317,7 +317,7 @@ impl<'a, T> Iterator for OutputChannelsIter<'a, T> { } } -impl<'a, S> ExactSizeIterator for OutputChannelsIter<'a, S> { +impl ExactSizeIterator for OutputChannelsIter<'_, S> { #[inline] fn len(&self) -> usize { self.data.len() diff --git a/plugin/src/process/audio/pair.rs b/plugin/src/process/audio/pair.rs index 1cd61d0b..57a7016c 100644 --- a/plugin/src/process/audio/pair.rs +++ b/plugin/src/process/audio/pair.rs @@ -324,7 +324,7 @@ impl<'a, S> Iterator for PairedChannelsIter<'a, S> { } } -impl<'a, S> ExactSizeIterator for PairedChannelsIter<'a, S> { +impl ExactSizeIterator for PairedChannelsIter<'_, S> { #[inline] fn len(&self) -> usize { self.input_iter.len().max(self.output_iter.len()) @@ -364,7 +364,7 @@ impl<'a> Iterator for PortPairsIter<'a> { } } -impl<'a> ExactSizeIterator for PortPairsIter<'a> { +impl ExactSizeIterator for PortPairsIter<'_> { #[inline] fn len(&self) -> usize { self.inputs.len().max(self.outputs.len())