A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 206fa51fcd30f6c53fadd442a63c963f86c0b957 (403 bytes)[doc][blame][raw]
1
use regex::Regex;3
pub fn to_array(value: String) -> Vec<String> {4
value5
.split(",")6
.map(str::to_string)7
.filter(|tag| tag.trim().len() > 0)8
.collect::<Vec<String>>()9
}11
pub fn upgrade_to_https(url: String) -> String {12
if Regex::new("^http://").unwrap().is_match(&url) {13
return format!("https://verbal.fm/api/upgrade?redirect={}", &url);14
}15
url16
}