1
0
Fork 0

Return -> Returns at the start of a docstring

The imperative tense doesn't make any sense when the function is a mere
getter and doesn't actually perform a nontrivial task.
This commit is contained in:
Robbert van der Helm 2022-04-26 19:39:03 +02:00
parent b481274f64
commit bb3175f68e
9 changed files with 13 additions and 13 deletions

View file

@ -65,7 +65,7 @@ impl EguiState {
}) })
} }
/// Return a `(width, height)` pair for the current size of the GUI in logical pixels. /// Returns a `(width, height)` pair for the current size of the GUI in logical pixels.
pub fn size(&self) -> (u32, u32) { pub fn size(&self) -> (u32, u32) {
self.size.load() self.size.load()
} }

View file

@ -158,7 +158,7 @@ pub trait IcedEditor: 'static + Send + Sync + Sized {
context: Arc<dyn GuiContext>, context: Arc<dyn GuiContext>,
) -> (Self, Command<Self::Message>); ) -> (Self, Command<Self::Message>);
/// Return a reference to the GUI context. /// Returns a reference to the GUI context.
/// [`handle_param_message()`][Self::handle_param_message()] uses this to interact with the /// [`handle_param_message()`][Self::handle_param_message()] uses this to interact with the
/// parameters. /// parameters.
fn context(&self) -> &dyn GuiContext; fn context(&self) -> &dyn GuiContext;
@ -240,7 +240,7 @@ impl IcedState {
}) })
} }
/// Return a `(width, height)` pair for the current size of the GUI in logical pixels. /// Returns a `(width, height)` pair for the current size of the GUI in logical pixels.
pub fn size(&self) -> (u32, u32) { pub fn size(&self) -> (u32, u32) {
self.size.load() self.size.load()
} }

View file

@ -95,7 +95,7 @@ impl ViziaState {
}) })
} }
/// Return a `(width, height)` pair for the current size of the GUI in logical pixels, after /// Returns a `(width, height)` pair for the current size of the GUI in logical pixels, after
/// applying the user scale factor. /// applying the user scale factor.
pub fn scaled_logical_size(&self) -> (u32, u32) { pub fn scaled_logical_size(&self) -> (u32, u32) {
let (logical_width, logical_height) = self.size.load(); let (logical_width, logical_height) = self.size.load();
@ -107,7 +107,7 @@ impl ViziaState {
) )
} }
/// Return a `(width, height)` pair for the current size of the GUI in logical pixels before /// Returns a `(width, height)` pair for the current size of the GUI in logical pixels before
/// applying the user scale factor. /// applying the user scale factor.
pub fn inner_logical_size(&self) -> (u32, u32) { pub fn inner_logical_size(&self) -> (u32, u32) {
self.size.load() self.size.load()

View file

@ -28,7 +28,7 @@ pub struct Buffer<'a> {
} }
impl<'a> Buffer<'a> { impl<'a> Buffer<'a> {
/// Return the numer of samples in this buffer. /// Returns the numer of samples in this buffer.
#[inline] #[inline]
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
if self.output_slices.is_empty() { if self.output_slices.is_empty() {
@ -38,7 +38,7 @@ impl<'a> Buffer<'a> {
} }
} }
/// Return the numer of channels in this buffer. /// Returns the numer of channels in this buffer.
#[inline] #[inline]
pub fn channels(&self) -> usize { pub fn channels(&self) -> usize {
self.output_slices.len() self.output_slices.len()

View file

@ -131,7 +131,7 @@ impl<'slice, 'sample> Block<'slice, 'sample> {
self.current_block_end - self.current_block_start self.current_block_end - self.current_block_start
} }
/// Return the numer of channels in this buffer. /// Returns the numer of channels in this buffer.
#[inline] #[inline]
pub fn channels(&self) -> usize { pub fn channels(&self) -> usize {
unsafe { (*self.buffers).len() } unsafe { (*self.buffers).len() }

View file

@ -24,7 +24,7 @@ pub trait ProcessContext {
/// Get information about the current transport position and status. /// Get information about the current transport position and status.
fn transport(&self) -> &Transport; fn transport(&self) -> &Transport;
/// Return the next note event, if there is one. Use [`NoteEvent::timing()`] to get the event's /// Returns the next note event, if there is one. Use [`NoteEvent::timing()`] to get the event's
/// timing within the buffer. Only available when /// timing within the buffer. Only available when
/// [`Plugin::MIDI_INPUT`][crate::prelude::Plugin::MIDI_INPUT] is set. /// [`Plugin::MIDI_INPUT`][crate::prelude::Plugin::MIDI_INPUT] is set.
/// ///

View file

@ -166,7 +166,7 @@ pub enum NoteEvent {
} }
impl NoteEvent { impl NoteEvent {
/// Return the sample within the current buffer this event belongs to. /// Returns the sample within the current buffer this event belongs to.
pub fn timing(&self) -> u32 { pub fn timing(&self) -> u32 {
match &self { match &self {
NoteEvent::NoteOn { timing, .. } => *timing, NoteEvent::NoteOn { timing, .. } => *timing,

View file

@ -72,13 +72,13 @@ pub trait Param: Display {
/// UI. /// UI.
fn step_count(&self) -> Option<usize>; fn step_count(&self) -> Option<usize>;
/// Return the previous step from a specific value for this parameter. This can be the same as /// Returns the previous step from a specific value for this parameter. This can be the same as
/// `from` if the value is at the start of its range. This is mainly used for scroll wheel /// `from` if the value is at the start of its range. This is mainly used for scroll wheel
/// interaction in plugin GUIs. When the parameter is not discrete then a step should cover one /// interaction in plugin GUIs. When the parameter is not discrete then a step should cover one
/// hundredth of the normalized range instead. /// hundredth of the normalized range instead.
fn previous_step(&self, from: Self::Plain) -> Self::Plain; fn previous_step(&self, from: Self::Plain) -> Self::Plain;
/// Return the next step from a specific value for this parameter. This can be the same as /// Returns the next step from a specific value for this parameter. This can be the same as
/// `from` if the value is at the end of its range. This is mainly used for scroll wheel /// `from` if the value is at the end of its range. This is mainly used for scroll wheel
/// interaction in plugin GUIs. When the parameter is not discrete then a step should cover one /// interaction in plugin GUIs. When the parameter is not discrete then a step should cover one
/// hundredth of the normalized range instead. /// hundredth of the normalized range instead.

View file

@ -234,7 +234,7 @@ pub trait Editor: Send + Sync {
context: Arc<dyn GuiContext>, context: Arc<dyn GuiContext>,
) -> Box<dyn Any + Send + Sync>; ) -> Box<dyn Any + Send + Sync>;
/// Return the (currnent) size of the editor in pixels as a `(width, height)` pair. This size /// Returns the (currnent) size of the editor in pixels as a `(width, height)` pair. This size
/// must be reported in _logical pixels_, i.e. the size before being multiplied by the DPI /// must be reported in _logical pixels_, i.e. the size before being multiplied by the DPI
/// scaling factor to get the actual physical screen pixels. /// scaling factor to get the actual physical screen pixels.
fn size(&self) -> (u32, u32); fn size(&self) -> (u32, u32);