so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: f3f1fd50aa3488f411e529797be65d0eaf1bd938 (428 bytes)[doc][blame][raw]

1use regex::Regex;

2

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

4 value.split(",")

5 .map(str::to_string)

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

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

8}

9

10pub fn upgrade_to_https(url: String) -> String {

11 if Regex::new("^http://")

12 .unwrap()

13 .is_match(&url)

14 {

15 return format!("https://verbal.fm/api/upgrade?redirect={}", &url);

16 }

17 url

18}