Address some unused_must_use warnings for ControlFlow

As seen on nightly Rust.
This commit is contained in:
Johannes Altmanninger
2025-04-01 14:28:06 +02:00
parent 415da8fc3b
commit f88470aa3c
2 changed files with 4 additions and 3 deletions

View File

@@ -663,7 +663,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 {
@@ -3819,7 +3820,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

@@ -1008,7 +1008,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));
}
}