fix: remove empty string from filters

This commit is contained in:
2025-10-30 08:56:25 -03:00
parent 6b12637d0a
commit 5bb0ad8b1a

View File

@@ -177,7 +177,7 @@ fn main() -> anyhow::Result<()> {
// Read system prompt // Read system prompt
let prompt = std::fs::read_to_string("PROMPT.txt").unwrap(); let prompt = std::fs::read_to_string("PROMPT.txt").unwrap();
let filter_file_contents = std::fs::read_to_string("FILTER.txt").unwrap_or(String::new()); let filter_file_contents = std::fs::read_to_string("FILTER.txt").unwrap_or(String::new());
let filter_keywords = filter_file_contents.split("\n").collect::<Vec<&str>>(); let filter_keywords = filter_file_contents.split("\n").filter(|keyword| !keyword.is_empty()).collect::<Vec<&str>>();
let talks_array = get_piperun_chats_on_date(&PIPERUN_API_URL, &client, &access_token, formatted_day_before_at_midnight, formatted_day_before_at_23_59_59); let talks_array = get_piperun_chats_on_date(&PIPERUN_API_URL, &client, &access_token, formatted_day_before_at_midnight, formatted_day_before_at_23_59_59);