Skip to content

Commit

Permalink
minor syntax tweaks and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ro6ley committed Mar 28, 2023
1 parent 623a680 commit 6a02040
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/interruption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use lazy_static::lazy_static;
use regex::Regex;
use std::fmt::{Display, Formatter, Result};


lazy_static! {
static ref INTERRUPTION_RE: Regex = Regex::new(r"(?mi)^(?P<region>[a-z\s]*\sregion)?\s*((parts\sof)?\b(?P<county>[a-z\s]*\scounty\b))?\s*(\barea:?)\s\b(?P<area>[a-z\s,\.]*)(\bdate:?)\s\b(?P<day>[a-z]*)\b\s*(?P<date>[\d\.]*)\b\s(\btime:?)\s\b(?P<start>[\d\.]*)\b\s\b(?P<start_period>[ap]\.m\.)\s*[-~—]\s*\b(?P<end>[\d\.]*)\s*(?P<end_period>[ap]\.m\.)\s*(?P<locations>[a-z0-9&,\s\.-]*)\n")
.expect("Error compiling regex");
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{collections::HashMap, env};
use tokio::time::Duration;

#[tokio::main]
async fn main() {
async fn main() -> ! {
env_logger::init();

let watchlist: String = env::var("WATCHLIST").expect("$WATCHLIST env var is not set");
Expand Down
2 changes: 1 addition & 1 deletion src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn search(full_texts: Vec<String>, locations: String) -> tantivy::Result<boo
// abc,xyz -> "abc" OR "xyz"
let formatted_locations: String = locations
.split(',')
.map(|s| format!("\"{}\"", s))
.map(|s| format!("\"{s}\""))
.collect::<Vec<String>>()
.join(" OR ");

Expand Down

0 comments on commit 6a02040

Please sign in to comment.