improve cap

This commit is contained in:
rustdesk 2025-04-29 23:27:43 +08:00
parent f0c5580f57
commit 2864e1984a

View file

@ -2318,16 +2318,21 @@ impl LoginConfigHandler {
display_name = crate::username(); display_name = crate::username();
} }
let display_name = display_name let display_name = display_name
.chars() .split_whitespace()
.enumerate() .map(|word| {
.map(|(i, c)| { word.chars()
if i == 0 { .enumerate()
c.to_uppercase().to_string() .map(|(i, c)| {
} else { if i == 0 {
c.to_string() c.to_uppercase().to_string()
} } else {
c.to_string()
}
})
.collect::<String>()
}) })
.collect::<String>(); .collect::<Vec<_>>()
.join(" ");
#[cfg(not(target_os = "android"))] #[cfg(not(target_os = "android"))]
let my_platform = whoami::platform().to_string(); let my_platform = whoami::platform().to_string();
#[cfg(target_os = "android")] #[cfg(target_os = "android")]