Skip to content

Commit

Permalink
shell: Make .and() return an impl trait
Browse files Browse the repository at this point in the history
This fixes a grave type inferrence issue, and while technically a
breaking change, is not expected to cause trouble (because there is no
reason someone would name the returned type directly).

Closes: #76
  • Loading branch information
chrysn committed Aug 20, 2024
1 parent 7b3aec0 commit c805e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub trait CommandList<const BUFSIZE: usize = { riot_sys::SHELL_DEFAULT_BUFSIZE a
/// The handler will be called every time the command is entered, and is passed the arguments
/// including its own name in the form of [Args]. Currently, RIOT ignores the return value of
/// the function.
fn and<'a, H, T>(self, name: &'a CStr, desc: &'a CStr, handler: H) -> Command<'a, Self, H, T>
fn and<'a, H, T>(self, name: &'a CStr, desc: &'a CStr, handler: H) -> impl CommandList<BUFSIZE>
where
H: FnMut(&mut stdio::Stdio, Args<'_>) -> T,
T: crate::main::Termination,
Expand Down

0 comments on commit c805e42

Please sign in to comment.