Skip to content

Commit

Permalink
shell: Remove _providing_buf suffix from names, making the old versio…
Browse files Browse the repository at this point in the history
…ns deprecated aliases
  • Loading branch information
chrysn committed Aug 19, 2024
1 parent b238672 commit c75bd1c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ pub trait CommandList<const BUFSIZE: usize = { riot_sys::SHELL_DEFAULT_BUFSIZE a
/// [shell_run_forever]: https://doc.riot-os.org/group__sys__shell.html#ga3d3d8dea426c6c5fa188479e53286aec
///
/// The line buffer is allocated inside this function with the size configured as part of the
/// trait type; use `.with_buffer_size::<>()` to alter that. The method will be renamed to
/// `run_forever` once that name is free.
/// trait type; use `.with_buffer_size::<>()` to alter that.
#[doc(alias = "shell_run_forever")]
fn run_forever_providing_buf(&mut self) -> ! {
fn run_forever(&mut self) -> ! {
let mut linebuffer = [0; BUFSIZE];
self.run_forever_with_buf(&mut linebuffer)
}
Expand All @@ -166,14 +165,23 @@ pub trait CommandList<const BUFSIZE: usize = { riot_sys::SHELL_DEFAULT_BUFSIZE a
/// [shell_run_once]: https://doc.riot-os.org/group__sys__shell.html#ga3d3d8dea426c6c5fa188479e53286aec
///
/// The line buffer is allocated inside this function with the size configured as part of the
/// trait type; use `.with_buffer_size::<>()` to alter that. The method will be renamed to
/// `run_once` once that name is free.
/// trait type; use `.with_buffer_size::<>()` to alter that.
#[doc(alias = "shell_run_once")]
fn run_once_providing_buf(&mut self) {
fn run_once(&mut self) {
let mut linebuffer = [0; BUFSIZE];
self.run_once_with_buf(&mut linebuffer)
}

#[deprecated(note = "Renamed to run_forever", since = "0.9")]
fn run_forever_providing_buf(&mut self) -> ! {
self.run_forever()
}

#[deprecated(note = "Renamed to run_once", since = "0.9")]
fn run_once_providing_buf(&mut self) {
self.run_once()
}

/// Extend the list of commands by an additional one.
///
/// The handler will be called every time the command is entered, and is passed the arguments
Expand Down

0 comments on commit c75bd1c

Please sign in to comment.