Commit 3d49399c authored by Felix Häcker's avatar Felix Häcker

Merge branch 'smaller_char_replacing' into 'master'

Smaller char replacing

See merge request !396
parents b08ac59c d89cbb77
Pipeline #200896 passed with stages
in 17 minutes and 7 seconds
......@@ -95,20 +95,8 @@ where
gtk::idle_add(move || data.next().map(|x| func(x)).map(|_| glib::Continue(true)).unwrap_or_else(|| glib::Continue(false)));
}
// Removes special chars from a string
// If anybody knows a better way to do this, feel free to open a MR on GitLab :)
pub fn simplify_string(s: String) -> String {
let mut string = s.replace("/", "");
string = string.replace("\\", "");
string = string.replace(":", "");
string = string.replace("<", "");
string = string.replace(">", "");
string = string.replace("\"", "");
string = string.replace("|", "");
string = string.replace("?", "");
string = string.replace("*", "");
string = string.replace(".", "");
string
s.replace(&['/', '\\', ':', '<', '>', '\"', '|', '?', '*', '.'] as &[_], "")
}
pub fn station_subtitle(country: &str, state: &str, votes: i32) -> String {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment