From 8f3a25d749c8a3b3ac58ccd270a7ab53dc374ac7 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 8 Mar 2021 22:16:25 +0100 Subject: [PATCH] clippy fix --- egui/src/data/output.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egui/src/data/output.rs b/egui/src/data/output.rs index edca2ea7..fcbaf8ab 100644 --- a/egui/src/data/output.rs +++ b/egui/src/data/output.rs @@ -35,7 +35,7 @@ impl Output { /// This can be used by a text-to-speech system to describe the events (if any). pub fn events_description(&self) -> String { // only describe last event: - for event in self.events.iter().rev() { + if let Some(event) = self.events.iter().rev().next() { match event { OutputEvent::WidgetEvent(WidgetEvent::Focus, widget_info) => { return widget_info.description();