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();
}
let display_name = display_name
.chars()
.enumerate()
.map(|(i, c)| {
if i == 0 {
c.to_uppercase().to_string()
} else {
c.to_string()
}
.split_whitespace()
.map(|word| {
word.chars()
.enumerate()
.map(|(i, c)| {
if i == 0 {
c.to_uppercase().to_string()
} else {
c.to_string()
}
})
.collect::<String>()
})
.collect::<String>();
.collect::<Vec<_>>()
.join(" ");
#[cfg(not(target_os = "android"))]
let my_platform = whoami::platform().to_string();
#[cfg(target_os = "android")]