so://phie

verbal

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

blob: 3642cdfef899a435c79ad7644cc737b6cb06a18f (405 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().is_empty())

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}