refactoring

This commit is contained in:
euzu
2024-05-10 10:13:50 +02:00
parent 13728a636f
commit f5a5901cf1
27 changed files with 251 additions and 244 deletions
+3 -3
View File
@@ -3,9 +3,9 @@
pub (crate) fn get_title_group(text: &str) -> String {
let alphabetic_only: String = text.chars().map(|c| if c.is_alphanumeric() { c } else { ' ' }).collect();
let parts = alphabetic_only.split_whitespace();
let mut combination = "".to_string();
for p in parts.into_iter() {
combination = format!("{} {}", combination, p).trim().to_string();
let mut combination = String::new();
for p in parts {
combination = format!("{combination} {p}").trim().to_string();
if combination.len() > 2 {
return combination;
}