Fix some unused-ControlFlow warnings

This commit is contained in:
Johannes Altmanninger
2025-07-25 18:10:52 +02:00
parent 0e7c7f1745
commit d2af306f3d
2 changed files with 5 additions and 4 deletions

View File

@@ -656,7 +656,8 @@ fn index_mut(&mut self, index: usize) -> &mut Self::Output {
impl Acceptor for $name {
#[allow(unused_variables)]
fn accept<'a>(&'a self, visitor: &mut dyn NodeVisitor<'a>, reversed: bool) {
accept_list_visitor!(Self, accept, visit, self, visitor, reversed, $contents);
let _ =
accept_list_visitor!(Self, accept, visit, self, visitor, reversed, $contents);
}
}
impl AcceptorMut for $name {
@@ -743,7 +744,7 @@ macro_rules! implement_acceptor_for_branch {
impl Acceptor for $name {
#[allow(unused_variables)]
fn accept<'a>(&'a self, visitor: &mut dyn NodeVisitor<'a>, reversed: bool){
visitor_accept_field!(
let _ = visitor_accept_field!(
Self,
accept,
visit,
@@ -3718,7 +3719,7 @@ fn allocate<T: NodeMut + Default>(&self) -> Box<T> {
// Return the resulting Node pointer. It is never null.
fn allocate_visit<T: NodeMut + Default>(&mut self) -> Box<T> {
let mut result = Box::<T>::default();
self.visit_mut(&mut *result);
let _ = self.visit_mut(&mut *result);
result
}

View File

@@ -980,7 +980,7 @@ pub fn reader_execute_readline_cmd(parser: &Parser, ch: CharEvent) {
data.rls = Some(ReadlineLoopState::new());
}
data.save_screen_state();
data.handle_char_event(Some(ch));
let _ = data.handle_char_event(Some(ch));
}
}