bro, i was clippying it...
This commit is contained in:
parent
bb745c9595
commit
bbfa3d5698
1 changed files with 6 additions and 6 deletions
12
src/main.rs
12
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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue