1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Use a lot more let-else (#7582)

This commit is contained in:
Emil Ernerfeldt
2025-10-02 19:47:00 +02:00
committed by GitHub
parent 4c1f344ef8
commit bd45406fad
45 changed files with 812 additions and 847 deletions

View File

@@ -10,11 +10,11 @@ struct DeduplicatedHistory {
impl DeduplicatedHistory {
fn add(&mut self, text: String) {
if let Some(entry) = self.history.back_mut() {
if entry.text == text {
entry.repeated += 1;
return;
}
if let Some(entry) = self.history.back_mut()
&& entry.text == text
{
entry.repeated += 1;
return;
}
self.history.push_back(HistoryEntry { text, repeated: 1 });
if self.history.len() > 100 {