From bbfa3d569818694db5d540230518f6358e0f543c Mon Sep 17 00:00:00 2001 From: Ash Vollmer Date: Wed, 5 Aug 2026 21:19:57 +0200 Subject: [PATCH] bro, i was clippying it... --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3e0868a..ac2946c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,18 +36,22 @@ impl EventHandler for Handler { "Betroffene Linien: {}", new.affected_lines .iter() - .fold(String::new(), |acc, a| acc + &format!("{}", a.to_string())) + .fold(String::new(), |acc, a| acc + &a.to_string()) )); let timestamp: Timestamp = new.last_modified.parse().expect("Invalid timestamp!"); let color = new.get_line_color(); new.get_validity_period(); - let embed = if new.from.is_none() || new.to.is_none() { + let embed = if let (Some(from), Some(to)) = (new.from, new.to) { CreateEmbed::new() .title(new.headline) .description(new.detail) .color(Colour::from_rgb(color.0, color.1, color.2)) .timestamp(timestamp) + .fields(vec![ + ("Start", from.to_string(), true), + ("Ende", to.to_string(), true), + ]) .field( "Fahrtrichtungen", format!("{} & {}", &new.dest_1, &new.dest_2), @@ -60,10 +64,6 @@ impl EventHandler for Handler { .description(new.detail) .color(Colour::from_rgb(color.0, color.1, color.2)) .timestamp(timestamp) - .fields(vec![ - ("Start", new.from.unwrap().to_string(), true), - ("Ende", new.to.unwrap().to_string(), true), - ]) .field( "Fahrtrichtungen", format!("{} & {}", new.dest_1, new.dest_2),