Commit d89cbb77 authored by lorenzo's avatar lorenzo

smaller char replacing

parent bdd0355f
......@@ -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