mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-06 07:52:18 +02:00
refactoring
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user