so://phie

verbal

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]

1use regex::Regex;

2

3pub fn to_array(value: String) -> Vec<String> {

4 value

5 .split(",")

6 .map(str::to_string)

7 .filter(|tag| tag.trim().len() > 0)

8 .collect::<Vec<String>>()

9}

10

11pub 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 url

16}