From 47a96ee02b482835fff0f25bf9ade54b5db5b0d9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 27 Mar 2022 03:32:45 +0200 Subject: [PATCH] Fix broken rustdoc links --- nih_plug_vizia/src/widgets/param_slider.rs | 4 ++-- nih_plug_vizia/src/widgets/peak_meter.rs | 2 -- src/buffer/blocks.rs | 10 ++++++---- src/buffer/samples.rs | 11 ++++++----- src/formatters.rs | 8 ++++---- src/util/stft.rs | 4 ++-- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/nih_plug_vizia/src/widgets/param_slider.rs b/nih_plug_vizia/src/widgets/param_slider.rs index 1dbc25e0..3e6187fc 100644 --- a/nih_plug_vizia/src/widgets/param_slider.rs +++ b/nih_plug_vizia/src/widgets/param_slider.rs @@ -11,7 +11,7 @@ use super::RawParamEvent; const GRANULAR_DRAG_MULTIPLIER: f32 = 0.1; /// A slider that integrates with NIH-plug's [`Param`] types. Use the -/// [`set_style()`][Self::set_style()] method to change how the value gets displayed. +/// [`set_style()`][ParamSliderExt::set_style()] method to change how the value gets displayed. /// /// TODO: Handle scrolling for steps (and shift+scroll for smaller steps?) /// TODO: We may want to add a couple dedicated event handlers if it seems like those would be @@ -34,7 +34,7 @@ pub struct ParamSlider { } /// How the [`ParamSlider`] should display its values. Set this using -/// [`ParamSliderExt::slider_style()`]. +/// [`ParamSliderExt::set_style()`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, Data)] pub enum ParamSliderStyle { /// Visualize the offset from the default value for continuous parameters with a default value diff --git a/nih_plug_vizia/src/widgets/peak_meter.rs b/nih_plug_vizia/src/widgets/peak_meter.rs index d2c019ea..78b02d95 100644 --- a/nih_plug_vizia/src/widgets/peak_meter.rs +++ b/nih_plug_vizia/src/widgets/peak_meter.rs @@ -39,8 +39,6 @@ where impl PeakMeter { /// Creates a new [`PeakMeter`] for the given value in decibel, optionally holding the peak /// value for a certain amount of time. - /// - /// See [`PeakMeterExt`] for additonal options. pub fn new( cx: &mut Context, level_dbfs: L, diff --git a/src/buffer/blocks.rs b/src/buffer/blocks.rs index 25201d26..51ed60ba 100644 --- a/src/buffer/blocks.rs +++ b/src/buffer/blocks.rs @@ -8,8 +8,8 @@ use std::simd::{LaneCount, Simd, SupportedLaneCount}; use super::SamplesIter; /// An iterator over all samples in the buffer, slicing over the sample-dimension with a maximum -/// size of `max_block_size`. See [`Buffer::iter_blocks()`]. Yields both the block and the offset -/// from the start of the buffer. +/// size of `max_block_size`. See [`Buffer::iter_blocks()`][super::Buffer::iter_blocks()]. Yields +/// both the block and the offset from the start of the buffer. pub struct BlocksIter<'slice, 'sample: 'slice> { /// The raw output buffers. pub(super) buffers: *mut [&'sample mut [f32]], @@ -152,7 +152,8 @@ impl<'slice, 'sample> Block<'slice, 'sample> { } /// Iterate over this block on a per-sample per-channel basis. This is identical to - /// [`Buffer::iter_samples()`] but for a smaller block instead of the entire buffer + /// [`Buffer::iter_samples()`][super::Buffer::iter_samples()] but for a smaller block instead of + /// the entire buffer #[inline] pub fn iter_samples(&mut self) -> SamplesIter<'slice, 'sample> { SamplesIter { @@ -272,7 +273,8 @@ impl<'slice, 'sample> Block<'slice, 'sample> { } /// Write data from a SIMD vector to this sample's channel data for a specific sample in this - /// block. This takes the padding added by [`to_simd()`][Self::to_simd()] into account. + /// block. This takes the padding added by [`to_channel_simd()`][Self::to_channel_simd()] into + /// account. /// /// Returns `false` if `sample_index` is out of bounds. #[cfg(feature = "simd")] diff --git a/src/buffer/samples.rs b/src/buffer/samples.rs index 6700836a..417c417f 100644 --- a/src/buffer/samples.rs +++ b/src/buffer/samples.rs @@ -19,9 +19,9 @@ pub struct SamplesIter<'slice, 'sample: 'slice> { } /// Can construct iterators over actual iterator over the channel data for a sample, yielded by -/// [`SamplesIter`]. Can be turned into an iterator, or [`Channels::iter_mut()`] can be used to -/// iterate over the channel data multiple times, or more efficiently you can use -/// [`Channels::get_unchecked_mut()`] to do the same thing. +/// [`SamplesIter`]. Can be turned into an iterator, or [`ChannelSamples::iter_mut()`] can be used +/// to iterate over the channel data multiple times, or more efficiently you can use +/// [`ChannelSamples::get_unchecked_mut()`] to do the same thing. pub struct ChannelSamples<'slice, 'sample: 'slice> { /// The raw output buffers. pub(self) buffers: *mut [&'sample mut [f32]], @@ -29,7 +29,7 @@ pub struct ChannelSamples<'slice, 'sample: 'slice> { pub(self) _marker: PhantomData<&'slice mut [&'sample mut [f32]]>, } -/// The actual iterator over the channel data for a sample, yielded by [`Channels`]. +/// The actual iterator over the channel data for a sample, yielded by [`ChannelSamples`]. pub struct ChannelSamplesIter<'slice, 'sample: 'slice> { /// The raw output buffers. pub(self) buffers: *mut [&'sample mut [f32]], @@ -123,7 +123,8 @@ impl<'slice, 'sample> ChannelSamples<'slice, 'sample> { } /// A resetting iterator. This lets you iterate over the same channels multiple times. Otherwise - /// you don't need to use this function as [`Channels`] already implements [Iterator]. + /// you don't need to use this function as [`ChannelSamples`] already implements + /// [`IntoIterator`]. #[inline] pub fn iter_mut(&mut self) -> ChannelSamplesIter<'slice, 'sample> { ChannelSamplesIter { diff --git a/src/formatters.rs b/src/formatters.rs index 0b13f187..75ef608e 100644 --- a/src/formatters.rs +++ b/src/formatters.rs @@ -35,7 +35,7 @@ pub fn f32_gain_to_db(digits: usize) -> Arc String + Send + Sync> } /// Parse a decibel value to a linear voltage gain ratio. Handles the `dB` or `dBFS` units for you. -/// Used in conjunction with [`f32_lin_to_db`]. +/// Used in conjunction with [`f32_gain_to_db()`]. pub fn from_f32_gain_to_db() -> Arc Option + Send + Sync> { Arc::new(|string| { string @@ -99,14 +99,14 @@ pub fn from_f32_hz_then_khz() -> Arc Option + Send + Sync> }) } -/// Format an order/power of two. Useful in conjunction with [`from_power_of_two()`] to limit +/// Format an order/power of two. Useful in conjunction with [`from_i32_power_of_two()`] to limit /// integer parameter ranges to be only powers of two. pub fn i32_power_of_two() -> Arc String + Send + Sync> { Arc::new(|value| format!("{}", 1 << value)) } -/// Parse a parameter input string to a power of two. Useful in conjunction with [`power_of_two()`] -/// to limit integer parameter ranges to be only powers of two. +/// Parse a parameter input string to a power of two. Useful in conjunction with +/// [`i32_power_of_two()`] to limit integer parameter ranges to be only powers of two. pub fn from_i32_power_of_two() -> Arc Option + Send + Sync> { Arc::new(|string| string.parse().ok().map(|n: i32| (n as f32).log2() as i32)) } diff --git a/src/util/stft.rs b/src/util/stft.rs index 3ad0d6f4..5fc61ea6 100644 --- a/src/util/stft.rs +++ b/src/util/stft.rs @@ -237,8 +237,8 @@ impl StftHelper { /// specified size with the windowing function already applied. The summed reults will then be /// written back to `main_buffer` exactly one block later, which means that this function will /// introduce one block of latency. This can be compensated by calling - /// [`ProcessContext::set_latency()`][`crate::prelude::ProcessContext::set_latency()`] in your - /// plugin's initialization function. + /// [`ProcessContext::set_latency()`][`crate::prelude::ProcessContext::set_latency_samples()`] + /// in your plugin's initialization function. /// /// This function does not apply any gain compensation for the windowing. You will need to do /// that yoruself depending on your window function and the amount of overlap.