From 53700cf2205dcbe924c4a711b24e6d6ee6c179c9 Mon Sep 17 00:00:00 2001 From: Jeremy Smart Date: Thu, 17 Oct 2024 22:38:49 -0400 Subject: [PATCH 1/3] switch to dotenvy --- proxy/Cargo.toml | 2 +- proxy/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/Cargo.toml b/proxy/Cargo.toml index 3a91aed..d2648a5 100644 --- a/proxy/Cargo.toml +++ b/proxy/Cargo.toml @@ -8,7 +8,6 @@ actix-web = "4.4.0" anyhow = "1.0.75" chrono = { version = "0.4.31", features = [ "serde", "clock" ] } convert_case = "0.6.0" -dotenv = "0.15.0" json = "0.12.4" reqwest = { version = "0.11.22", features = ["blocking"] } serde = { version = "1.0.192", features = ["derive"] } @@ -17,3 +16,4 @@ url = "2.4.1" diesel = { version = "2.1.0", features = ["postgres"] } async-mutex = "1.4.0" chrono-tz = "0.8.6" +dotenvy = "0.15.7" diff --git a/proxy/src/main.rs b/proxy/src/main.rs index e10c520..73c5c9c 100644 --- a/proxy/src/main.rs +++ b/proxy/src/main.rs @@ -1,7 +1,7 @@ use actix_web::{get, web, App, HttpServer, Responder}; use chrono::{DateTime, Utc}; use convert_case::{Case, Casing}; -use dotenv::dotenv; +use dotenvy::dotenv; use std::env; From 70b62848b14bdbe6cc843affc12126a1c0375242 Mon Sep 17 00:00:00 2001 From: Jeremy Smart Date: Sat, 19 Oct 2024 16:29:49 -0400 Subject: [PATCH 2/3] improve efficiency without choosing one correct spelling of canceled --- proxy/src/calendar.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxy/src/calendar.rs b/proxy/src/calendar.rs index 713dc67..9f09b61 100644 --- a/proxy/src/calendar.rs +++ b/proxy/src/calendar.rs @@ -137,8 +137,7 @@ impl CalendarEvents { .iter() .find(|e| { e.location.as_ref().is_some_and(|l| l.contains(location)) - && !e.summary.contains("CANCELED") - && !e.summary.contains("CANCELLED") + && !e.summary.contains("CANCEL") }) .cloned() } From 3b5966782796451b721506b0b98851514959073e Mon Sep 17 00:00:00 2001 From: Jeremy Smart Date: Sat, 19 Oct 2024 16:30:47 -0400 Subject: [PATCH 3/3] explicitly ignore dotenv failures --- proxy/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main.rs b/proxy/src/main.rs index 73c5c9c..b13955d 100644 --- a/proxy/src/main.rs +++ b/proxy/src/main.rs @@ -93,7 +93,7 @@ async fn oh_hi() -> impl Responder { async fn main() -> std::io::Result<()> { println!("Launching sidegrade4-proxy"); println!("Check dotenv"); - dotenv().ok(); + let _ = dotenv(); println!("Run webserver"); let cache = web::Data::new(EventCache {